0

Most of the popular articles in the internet: let and const variables are hoisted but not initialized with undefined.

But when using the debugger in chrome and adding breakpoint before let variable declaration, script scope will show let and const variable to be undefined (Reference Screenshot).

Why ? Are all of those articles wrong ? Or I am misinterpreting what the debugger is saying ?

Prazil
  • 1
  • 1
  • 4
    Does this answer your question? [Are variables declared with let or const hoisted?](https://stackoverflow.com/questions/31219420/are-variables-declared-with-let-or-const-hoisted) – Ozgur Sar Nov 28 '20 at 13:25
  • Not exactly, let and const are hoisted but my question here is that are they really uninitialized ??(Almost every articles in internet and answers in stackoverflow say that they are uninitialized) .Then Why the debugger shows undefined in script scope before the variable declaration ?? – Prazil Nov 28 '20 at 13:37

0 Answers0