WeCodeAcademy

string, number and boolean

The three most common types are string (text), number (integers and decimals) and boolean (true or false).

Exampletypescript
Open in editor »

A type also tells you what you may do with a value. Numbers have toFixed; strings do not.

Exampletypescript
Open in editor »
Quick check

Which type holds `true` or `false`?

Your turn: write the code

Declare name as a string ("Ada") and age as a number (36), both with type annotations, and print them with console.log(name, age).

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.