Hacker News new | ask | show | jobs
by alkonaut 4007 days ago
I feel like in a new design you would pick one or the other, as a second scoping rule would not carry its own weight in terms of what problems it solves vs the complexity of implementing runtimes or learning the language. In that case I'm almost certain you would go for block only as it is the default in nearly all curly braced languages.
2 comments

Yes, as a matter of style you could just use let everywhere, and know that var is there for legacy compatibility reasons.
I think they have selected one over the other - let. var exists for compatibility, but there is zero reason to use it in new code.