zaagan
7/4/2019 - 8:56 AM

JavaScript Scope - Let

JavaScript Scope - Let

let x = 0;
console.log(x);

if (true) {
  let x = 1 
  console.log(x);
}

console.log(x);

// Output :
// 0
// 1
// 0