I\'ve heard that accessing let and const values before they are initialized can cause a ReferenceError because of something called the
Hoisting:
let,const,var are all get hoisted process.
(whats mean they go upper and declare in the top of the scope.)
Initialisation:
var go also through the initial process, and get initial value of undefined.let,const didn't go throw the initial process, so their values are still inaccessible, although they already declared.
whats put them in temporal dead zoneSo in shortly:
hoisting process:
var,let,const
Initialisation process:var