The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Arrow Function => in ES6

Arrow Function => in ES6

2:57
ECMAscript 6 introduces the "arrow function" as a shortcut for creating anonymous functions with `this` scope bound.
Watch this lesson now
Avatar
egghead.io

ECMAscript 6 introduces the "arrow function" as a shortcut for creating anonymous functions with this scope bound.

Avatar
Michael

In the second example where you show that 'this' references the outer scope, what if you needed to access this.handleMessage inside of that function?

Avatar
James

It's a tall order, but if you could find ways to narrate the video above without using "this" as a demonstrative, and only as a JS keyword, then it would be a lot easier to take in. So when highlighting something, refer to "the highlighted section" instead of "this".

I appreciate this is easier said than done. ...dammit.

Avatar
Raunaq Singh

Examples covered in this course do a good job highlighting noteworthy differences between ES5 and ES6.

For practice I worked alongside the vids and have made a repo with the examples in ES5 and ES6 side by side—here's a link it it comes handy:
https://github.com/raunaqss/es6-egghead.io

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?