Well done!
You have completed Understanding Automatic Semicolon Insertion (ASI) and Reserved Words in JavaScript Quiz!
Quiz Question 1 of 5
Consider the following code:
let a = 5 \n (b + c).toString();
What would be the result of executing this code if there is no semicolon at the end of the first line?
Choose the correct answer below:
-
A
The code will return
undefined
becausea
and(b + c)
are treated as separate statements. -
B
The code will execute as if the lines were joined, leading to an error.
-
C
JavaScript will interpret this as a single statement, resulting in
5(b + c).toString()
causing an error. -
D
JavaScript will throw a syntax error due to invalid line breaks.