You've learned about JavaScript's two main data types: strings (text in quotes) and numbers (numeric values without quotes). The +
operator works differently with each type.
Engagement Message
Ready to practice spotting the differences?
Type
Multiple Choice
Practice Question
Which of these values is a string?
A. 42 B. "42" C. -15.5 D. 100
Suggested Answers
- A
- B - Correct
- C
- D
Type
Multiple Choice
Practice Question
What data type will the variable userName
be after this code runs?
A. Number B. String C. Variable D. Comment
Suggested Answers
- A
- B - Correct
- C
- D
Type
Sort Into Boxes
Practice Question
Sort these JavaScript values into their correct data type boxes:
Labels
- First Box Label: Strings
- Second Box Label: Numbers
First Box Items
- "Hello"
- "false"
- "2024"
Second Box Items
- 99.9
