Temporal Dead Zone?
Nov 6, 2021
let and const are in the temporal dead zone until they assign some value.
Hoisting is the phenomena by which we can access variables and function even before initializing them.
— — — — -Reference Error — — — -
console.log(a)
let a = 24; // this is in temporal dead zone
console.log(x) // x is not defined.
— — — — — Syntax Error — — — -
const a;
let a =4;
let a = 45;// this is all in syntax error
— — — — — -Type Error — — — —
*/
const d =234;
d =4; //this is type error because of , it is constant variable ,