Locked lesson.
About this lesson
Understanding the difference between strings and numbers; and understanding Boolean data types.
Exercise files
Download this lesson’s related exercise files.
Strings, Numbers, and Boolean Data Types.docx58.7 KB Strings, Numbers, and Boolean Data Types - Solution.docx
58.9 KB
Quick reference
Strings, Numbers, and Boolean Data Types
Strings, numbers, and booleans are all different types of data.
When to use
Strings, numbers, and booleans are something that you'll use all the time.
Instructions
What type of data a thing is, is important.
When trying to add a string to a number, JavaScript will put the two together into a string.
For example: 4 + "John Elder" becomes 4John Elder
Booleans are either True or False.
Hints & tips
- If you try to add strings, JavaScript pushes the two together.
- If you try to add a number to a string, JavaScript pushes the two together.
- Booleans are either True or False.
Lesson notes are only available for subscribers.