DEV Community

Discussion on: var, let, const: what's the difference?

Collapse
 
zyabxwcd profile image
Akash

nice. I faintly remembered that initialising thing with 'const'. The thing that you mentioned about temporal dead zone was really amusing. The fact that if you put it inside an async function like setTimeout, it will not result in an error.

Collapse
 
romaintrotard profile image
Romain Trotard

Thanks :)
Yep it's not straightforward to have it, it's really needed to think in a temporal way