Your description of let and const lacks some detail. Let isn't just "the new var". It has differences. For one part, var is globally scoped as when you do var this = "that" it is kind of linked to globalThis, while let is only available within the scope it was created in.
Some comments have been hidden by the post's author - find out more
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.
Your description of let and const lacks some detail. Let isn't just "the new var". It has differences. For one part, var is globally scoped as when you do
var this = "that"
it is kind of linked toglobalThis
, whilelet
is only available within the scope it was created in.