Simple answer: Yes.
Just like the various tools in a toolbox you use the right tool for the right job. Standard functions are still valid and probably will be as long as JavaScript exists.
Arrow functions are awesome when used correctly. But I often see people using them just to stop typing the word function
. I use arrow functions when it make sense, but I also use function
.
To me this:
let fnName = () => {}
seems silly and this:
let fnName = function fnName() {}
is even sillier, yet I see it all the time.
You really have to be aware of the this
pointer on arrow functions since they are the same as the code that defined them at the time they were defined.
As I mentioned in my response above here is a good article on some reasons to not use arrow functions:
And here are two other articles on the use of arrow functions: