What Really happens in hoisting?
This is how actually the above code looks like in initialization phase which means the variable declaration moves up but not the value since we accessing that value before initialization it shows “undefined”.
How does Hoisting works with let and const in JS
Then what about the output of this given code does it print undefined. This code does not give output this give an Error.
“ReferenceError: Cannot access ‘a’ before initialization”
What does this code does in this we are just access variable call “a” which is not even exists so this give an error .
“ReferenceError: a is not defined”.