DEV Community

Discussion on: Some JavaScript Principles you should know.

Collapse
 
matgott profile image
matgott

Hi man! Great article. I'm gona make a disclaimer if you allow me :)

I understand that we need to simplify things to make easier to learn for people. But in my experiencie with "hoisting" and "let and const" I think is better said that they are hoisting to but have a different behavior.

Its ok not explain why hoisting exists (related to how the execution context of JS works) that is an advance topic. BUTTT, for me was tricky after learn what hoisting is and read everywhere that "const and let aren't hoisted" and at the end that isn't true.

Just an opinion based on my experience, which doesn't mean that its a totally true.

Thanks for your amazing post !

Collapse
 
shaharafat profile image
Md. Shah Arafat

Yah. That was my lack of knowledge. let and const both are hoisted but we can't access it before declaration because of TDZ. Learnt something new. Thanks man.