Answers for "javascript + difference between let and var"

4

difference between "let" and "var"?

In simple words 'var' is function scoped and 'let' is block scoped
Posted by: Guest on October-02-2021
2

what to use let vs var js

/* DIFFERENCE BETWEEN LET AND VAR */

//LET EXAMPLE
{
  let a = 123;
};

console.log(a); // undefined

//VAR EXAMPLE
{
  var a = 123;
};

console.log(a); // 123
Posted by: Guest on June-15-2021

Code answers related to "javascript + difference between let and var"

Code answers related to "Javascript"

Browse Popular Code Answers by Language