Vidyalelo
JavaScript · Q49

Classes And Modules

Programming · JavaScript · question 49

Q49

Consider the following code snippet const pi=3.14; var pi=4; console.log(pi); What will be the output for the above code snippet?

A.
This will flash an error
Answer
B.
Prints 4
C.
Prints 3.14
D.
Ambiguity

Answer: Option A

Solution

Answer: Option A
Solution:
The above code snippet will flash an error. Attempts to alter the value or re-declaration causes errors.