Reasons to love JavaScript arrow functions

Justyna Kuchta
7 min readOct 8, 2019

Functions are one of the primary data structures in JavaScript; they’ve been around forever.

Arrow functions

ES6 introduces a new kind of function called the arrow function (sometimes called ‘fat arrow’ functions, utilizing the new token =>). Arrow functions are very similar to regular functions in behavior, but are quite different syntactically.

These functions have two major benefits — a very clean concise syntax and more intuitive scoping and this binding.

Those benefits have sometimes led to arrow functions being strictly preferred over other forms of function declaration.

For example — the popular airbnb eslint configuration enforces the use of JavaScript arrow functions any time you are creating an anonymous function.

However, like anything in engineering, arrow functions come with positives and negatives. There are tradeoffs to their use.

Learning those tradeoffs is key to using arrow functions well.

I am a big fan of anything that will help me type less, so I was very quick to embrace the arrow when I first saw it. I had just finished Mod 2 at Flatiron School, and as I was starting to dive deeper into JavaScript, I found myself feeling excited to learn the most powerful…

--

--

Justyna Kuchta

Web Developer based in Atlanta, GA. Book worm, cat lover, language geek. Open to new opportunities https://www.linkedin.com/in/justyna-kuchta-ab7b3b16/