Beginner · Lesson 3 of 12

Working with data types

Numbers, text, and true-or-false values behave differently. Adding numbers calculates a sum; combining strings joins text. Convert a value deliberately before using it in a calculation.

Try it for yourself

Run the example, then change one thing and see what happens.

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-83 lines

Expected output

36

Make it your own

Store a price and a quantity, then calculate their product.

A quick check

Which habit helps when learning working with data types?

PreviousNext lesson