Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: