Hacker News new | ask | show | jobs
by jakelazaroff 1866 days ago
Syntactic sugar is syntax that makes it easier ("sweeter") to do something the language can already do. For example, async/await is syntactic sugar for promises.

let isn't syntactic sugar — it's the only way to declare a reassignable block-scoped variable (as opposed to const, which can't be reassigned, and var, which is function-scoped or globally-scoped).

2 comments

The way to redefine a const is to define an object who's values are mutable. I strongly prefer that as I can couple the mutating behavior in a single object.
Thanks. I was thinking in BASIC, I guess.