Question 1
Back to Exercise
JavaScript refuses to run the code below. Which statement correctly describes the problem?
const prices = [120, 250 399, 75];
console.log(prices.length);
- A It prints 3
- B SyntaxError: elements must be separated by commas – 250 399 is invalid Correct
- C It prints 4
- D It treats 250399 as one number
Correct Answer: Option B
Two number literals next to each other are not valid syntax. Add the missing comma: [120, 250, 399, 75].
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!