Question 5
Back to Exercise
Which of these is a valid JavaScript variable name?
- A 2ndPrice
- B $price_2 Correct
- C final-price
- D new
Correct Answer: Option B
Identifiers may contain letters, digits, _ and $ but cannot start with a digit. The hyphen is the minus operator, and new is a reserved word.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!