Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Arrow Functions and Lexical Scoping "this"

    javascriptJavaScript

    Arrow functions came into existence with ES6. Since then they have been looked at as the fix all solution when running into problems with this in our code. However it might not magically work all the time and this lesson is designed to show you how it really resolves this. We first need to understand what lexical scope is. It references the author time of our code which can be confusing considering this is runtime dependant. Let's look at all three of these examples to figure out how arrow functions work with this.