News for hackers. Stuff that matters.
Re:A long list of (advanced) JavaScript questions, and their... by hn_throwaway_99 on Thursday May 16, 2024 @07:56PM (#40384808)
Besides yet another "damn, Javascript is whack" article, I thought a lot of the details were actually really interesting, and stuff that I either outright didn't know or had just forgotten because I use TypeScript and a lot of these thing would make the TS compiler complain.

For example, I can't remember the last time I used the `var` keyword, and I had either forgotten or never really realized it had subtly different semantics compared to `let` and `const`, e.g. with respect to hoisting rules.

Re:A long list of (advanced) JavaScript questions, and their... by tstrimple on Thursday May 16, 2024 @08:57PM (#40385225)
Which in this case most folks have moved on to let and const. But tons of code in the wild is still sprinkled with var. If you’re mostly working greenfield JavaScript, you can ignore a lot of the warts and have a pretty good experience. If you’re working on a lot of legacy stuff you’ll see mixed use of var and let and it’s quite helpful to understand the differences more fully.