I've been coding in JS on a daily basis for more than 10 years and today I learned there is a `with` statement in JS.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Edit: well, seems like it's been deprecated/forbidden since ES5 (2009), so it makes sense I've never seen it.
with (myShape.graphics) {
beginPath();
setFill(0xFF0000);
moveTo(6, 9);
// ...
} with (Math) with (console) log(PI)
It reminds me a bit of Clojure's doto.Also, I just want to remind you that JS isn't just React. There are plenty of libraries written in C that introduce breaking changes over the course of 3 years. Nothing will stop people from finding ways to complain about JS though, I know. The hate-boner is very real.
Assorted musing : Rust, OCaml under C disguise.
I do like Typescript though, as it adds some really nice ergonomics.
Anyway, things have changed a lot, and I recently worked on my first ever web app with native ES6 - no transpiling to ES5! It was... not nearly as bad as it used to be! Modules are a thing, and the language has evolved with things like async/await, evolved for the better, I think. The standard library is still horribly anaemic though - the number of "helper" functions needed is ridiculous.
But still, I would no longer classify myself as a hater. Progress at last :)