I have to admit I find it odd that you start with a "typical function":
constsomeString=()=>{return'some string'}
when that is bizzaro to me and not typical. Sure I see it a fair bit nowadays, it's not rare per se, but it is still distinctly a neologism and maybe it's old school but this is a typical function:
functionsomeString(){return'some string'}
Which, hey, is reminiscent of the banner image ;-).
One of the most fun things about functions though that you've missed IMHO is the loss of this, most especially in event handlers. It's also not uncommon to use classes as a means of encapsulating and isolating closely related code. And when your event handlers are methods of a class or functions inside of methods even, this becomes a fairly hefty issue.
To wit, we commonly see .bind(this) which is one of Javascript's painful little idiosyncrasies 😉
Some comments have been hidden by the post's author - find out more
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.
I have to admit I find it odd that you start with a "typical function":
when that is bizzaro to me and not typical. Sure I see it a fair bit nowadays, it's not rare per se, but it is still distinctly a neologism and maybe it's old school but this is a typical function:
Which, hey, is reminiscent of the banner image ;-).
One of the most fun things about functions though that you've missed IMHO is the loss of
this
, most especially in event handlers. It's also not uncommon to use classes as a means of encapsulating and isolating closely related code. And when your event handlers are methods of a class or functions inside of methods even,this
becomes a fairly hefty issue.To wit, we commonly see
.bind(this)
which is one of Javascript's painful little idiosyncrasies 😉