Arrow Functions and `this`
Learn how arrow functions interact with the `this` keyword. Learn how we can leverage their new rules of 'this' binding to make our code more intuitive and clean.
We'll cover the following
Arrow functions and
Arrow functions don’t follow any of the traditional rules of
Instead, arrow functions get their
this binding from their scope. We’ve discussed five rules to
this-binding. We can now add a 6th. Here they all are.
1 - If the
new keyword is used when calling the function,
this inside the function is a brand new object.