Overview of JavaScript ES6 features
I'm surprised by the state of const/let nowadays.<p>The well-known good practice: use const by default; use let when it's needed. At the release of ES6, it was the way to go. But everyday I notice libraries—and some really famous— that use let everywhere in their docs, or some really influent developers from Google or Facebook who share samples of code on Twitter using let when it's not needed [1]. I don't know why. Seems like most people now think that const is for declaring constants (in the traditional meaning, like const API_URL) when it's just the normal way to declare variables that don't need to be reassigned (so basically most variables).<p>Dan Abramov said: "some people say const is ugly" [2]. Well, if it's a matter of appearance...<p>[1] <a href="https://twitter.com/addyosmani/status/789126892402204673" rel="nofollow">https://twitter.com/addyosmani/status/789126892402204673</a><p>[2] <a href="https://twitter.com/dan_abramov/status/783708858803978240" rel="nofollow">https://twitter.com/dan_abramov/status/783708858803978240</a>