temporal dead zone
1. var vs let vs const
var
Function-scoped.
Can be redeclared and updated.
Hoisted to the top of the scope → initialized with undefined.
console.log(a); // undefined (hoisted)
var a = 10;
let
Block-scoped.
Can be updated, but not redeclared ...
yesamitsingh.hashnode.dev2 min read