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.
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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 !
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.