3 ms·
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
by jakelazaroff 6y 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).
- denton-scratch 6y agoThanks. I was thinking in BASIC, I guess.
- bstar77 6y agoThe 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.