Jason Knight
Apr 25, 2024

--

Huh, in FF console.log(this) outputs the function, but you're right, object properties ARE there.

Shame it only works with one method on the object, limiting its utility a heck of a lot. It's still the biggest problem with event handlers is you can't just send it an object method -- ANY method -- and have "this" work properly. You'd end up having to test "event" to figure out which sub-method to call which is one of the dumbest ways to handle events. (see almost every official "react" example)

And arrow functions dumbass "this is always window" is like the complete opposite direction needed.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet