scrimba
Learn Typescript
Learn primitive types
Benefits of using Typescript
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

Benefits of using Typescript
AboutCommentsNotes
Benefits of using Typescript
Expand for more info
index.ts
run
preview
console
// Benefits of TypeScript
// challenges:
// - give the screens innerHTML a string
// - change the two input values to numbers

const button = document.querySelector('.button')
const firstInput = document.querySelector('#first-input')
const secondInput = document.querySelector('#second-input')
const screen = document.querySelector('.screen')

function addNumbers(a,b) {
screen.innerHTML = a + b
}

button.addEventListener('click', () => addNumbers(firstInput.value, secondInput.value))
Console
/index.html
-7:02