JavaScript | JavaScript Basics| Question 3

Last Updated :
Discuss
Comments

What happens when variable shadowing occurs in JavaScript?

A local variable hides a global variable with the same name

A function is unable to access global variables

Variables are reset to default values

JavaScript automatically changes the value of the variable.

Share your thoughts in the comments