Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
The problems are not limited to event handlers, JQuery's utility functions are also affected by this. The project I am working on relies on JQuery quite a bit so I am defaulting to regular functions and, when need be, I am using arrow functions.
I like the event handler example here, really helps understand what is up with arrow functions. I wonder if that's why the newer JS functions pass the element you are checking through their arguments instead of through this.
Hi! Thanks for reading. Yeah, the problems certainly aren't limited to what I've written here. For example, they also can't be used as constructors.
"I wonder if that's why the newer JS functions pass the element you are checking through their arguments instead of through this." Which newer functions are you referring to?
Thank you for stopping by! I am a full-stack developer that combines the power of entrepreneurship and programming to make the lives of programmers easier.
Nevermind, I always thought that some of the array functions like filter and some are from ES2015 which, on further investigation, turned out to be false
Although, they work nicely with the arrow functions since they all take their values not from this but from the parameter of the functions you give it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The problems are not limited to event handlers, JQuery's utility functions are also affected by this. The project I am working on relies on JQuery quite a bit so I am defaulting to regular
function
s and, when need be, I am using arrow functions.I like the event handler example here, really helps understand what is up with arrow functions. I wonder if that's why the newer JS functions pass the element you are checking through their arguments instead of through
this
.Hi! Thanks for reading. Yeah, the problems certainly aren't limited to what I've written here. For example, they also can't be used as constructors.
"I wonder if that's why the newer JS functions pass the element you are checking through their arguments instead of through
this
." Which newer functions are you referring to?Nevermind, I always thought that some of the array functions like
filter
andsome
are from ES2015 which, on further investigation, turned out to be falseAlthough, they work nicely with the arrow functions since they all take their values not from
this
but from the parameter of the functions you give it.