News for hackers. Stuff that matters.
Re:JavaScript private class fields considered harmful by dexwiz on Saturday April 29, 2023 @05:04AM (#35751320)
Even without classes there are a ton of footguns involving ‘this’ and method scope. Fat arrow notation papered over a bunch of issues. But I have lost more than a few hours confused as to why changing between map and a loop completely broke/fix behavior. Or seen codebases absolutely peppered with unneeded ‘bind(this)’ like it would ward off evil. I had to spend some time studying before I really grokked it.

There are no comments on this comment yet.