Consider the following code snippet
const pi=3.14;
var pi=4;
What will be the output for the above code snippet?

A. This will flash an error

B. Prints 4

C. Prints 3.14

D. Ambiguity

Answer: Option A

Solution(By Examveda Team)

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

Join The Discussion

Related Questions on Classes and Modules