ES6, the arrow function

Damien Cosset - Sep 18 '17 - - Dev Community

I would love to know what other developers think about the arrow function in javascript. When I first learned ES6, I used it everywhere and every single time. Less verbose? Yes sir!

Then, I learned what the arrow function did under the covers and saw what my code looked like in retrospect.

Well, I find myself using it a lot less than before. I think it does hurt readability in many cases. It's less verbose, but I'm not really comfortable trading readability for fewer characters. I still use arrow functions, but now I'm always asking myself: would the function keyword be better here?

What do you think?

How do you use arrow functions?

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .