❗var has no block scope❗️
Last updated
Last updated
JS ⟩ variable ⟩ var ⟩ has no block scope
var in block doesn't have block scope, cannot shadow let variable in the outer enclosing scope.
var hoisting - var is hoisted to top of enclosing function scope.
let redeclaration not allowed even in sloppy mode❗️ - let doesn't allow redeclaration.