Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

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

  2. 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.

     none of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Variables declared with var are defined throughout the enclosing function. Variables declared with let are defined only within the closest enclosing block (and any blocks nested within it, of course).


Be The First To Comment