Chapter 6: ES6 Arrow Functions: Fat and Concise Syntax in JavaScript
by Kyle Pennell
Arrow functions were introduced with ES6 as a new syntax for writing JavaScript functions. They save developers time and simplify function scope. The good news is that many major modern browsers support the use of arrow functions.
This chapter will cover the details of arrow functions — how to use them, common syntaxes, common use cases, and gotchas/pitfalls.
What Are Arrow Functions?
Arrow functions – also called “fat arrow” functions, from CoffeeScript (a transcompiled language) — are a more concise syntax for writing function expressions. They utilize a new token, =>
, that looks like a fat arrow. Arrow functions are anonymous and change the way this
binds ...
Get Practical ES6 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.