Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

The main difference between the variables declared with var and with let is __________

a) var is confined to a particular function but let is not
b) let is confined to a particular function but var is not
c) var defines values based on conditions but let does not
d) let doesn’t let you change the value of the variable

Answer: b
Explanation: Variables declared with var have global scope whereas variable declared with let have block scope. Variables declared with let are defined only within the closest enclosing block (and any blocks nested within it, of course).

Join The Discussion