scrimba
21 web dev tips for 2021 🎇
Tip 7.1: TypeScript 2
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Tip 7.1: TypeScript 2
Expand for more info
index.ts
run
preview
console
// TypeScript Example Two
// Arrays

const inventory = ['bacon', 'eggs', 'flour', 'bananas']
const item = 'flour'

document.getElementById('item').innerHTML = item

function checkInventory(inventory, item) {
const resultDisplay = document.getElementById('result')
resultDisplay.innerHTML = inventory.includes(item)
}

checkInventory(inventory, item)
Console
/index.html
-6:16