Hacker News new | ask | show | jobs
by basicallydan 4181 days ago
> let considered harmful: The problem with let is that it is not “hoisted” to the top of its block, as var is with its containing function.

Interesting point, but I disagree. I think that the lack of hoisting is one of the benefits of `let`. It works in a different way, which is more in line with other languages. Sometimes, you don't want a bunch of variables at the top of your function. Many functions do not need to be executed in the way that hoisting makes easier.

By the way, quoting Betteridge’s law of headlines at the beginning of your article whose headline is a question does not mean you get a free pass of using such a headline ;)