Most variables in JavaScript are hoisted which means the variable assignment and declaration are moved to the top of the code block so the const test='THIS IS FOR A TEST' Is moved to the top of the code block and the reference error is avoided
const test='THIS IS FOR A TEST'
developer.mozilla.org/en-US/docs/G...
It says “Declarations using let and const are also not hoisted.“ ☹️
Ah ok. Didn't know es6 declarations aren't hoisted
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Most variables in JavaScript are hoisted which means the variable assignment and declaration are moved to the top of the code block so the
const test='THIS IS FOR A TEST'
Is moved to the top of the code block and the reference error is avoideddeveloper.mozilla.org/en-US/docs/G...
It says “Declarations using let and const are also not hoisted.“ ☹️
Ah ok. Didn't know es6 declarations aren't hoisted