Question 6
Back to Exercise
JavaScript refuses to run the code below. Which statement correctly describes the problem?
/*
let tax = 0.18; /* GST rate */
let total = 100 * (1 + tax);
*/
console.log("Billing disabled");
- A SyntaxError: block comments do not nest – the first */ ends the comment and the final */ is invalid code Correct
- B It prints Billing disabled
- C ReferenceError: tax is not defined
- D Only the GST rate comment is removed
Correct Answer: Option A
The comment ends after GST rate */. The next line is normal code and the lone */ at the end is a SyntaxError. Comment out code with // on each line instead.
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!