Discussion Forum : Classes And Modules
Question - 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?
Options:
A .  This will flash an error
B .  Prints 4
C .  Prints 3.14
D .  Ambiguity
Answer: Option A
The above code snippet will flash an error. Attempts to alter the value or re-declaration causes errors.

Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *