Arrow This

added by bpwndaddy
10/22/2015 3:27:48 PM

748 Views

One of the most vaunted features of ES6 is the new => arrow function syntax for abbreviated definitions of function expressions (aka “lambdas”). You hardly can’t find a blog post or conference talk or book about ES6 (or even tangentially related to it) that doesn’t lead with “=> is the new function“. Arrow function syntax has even permeated standards and specification documents, almost as if it’s always been there and we’re just discovering it. Those who follow me know I’m not a fan of => syntax, for a number of reasons. But don’t worry, this blog post is not about why I don’t like it. If you are interested in that discussion, see Chapter 2, ‘Arrow Functions’ of my YDKJS: ES6 & Beyond book. Here I want to clear up a little confusion around what exactly arrow functions do with this, arguments, etc. Actually, I have been guilty of not precisely explaining this topic in the past, and I want to clear the record. For example, here’s how I first explained it in YDKJS awhile back.


0 comments