Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.83 KB

File metadata and controls

34 lines (22 loc) · 1.83 KB

Lesson 6: functions

If some of the functions in lesson 6 were new to you, we hope the resource links here will help you:

<= GO BACK

Resource Links

.this keyword:

With regular functions, the value of '.this' is set based on how the function is called. With arrow functions, the value of '.this' is based on the function's surrounding context. In other words, the value of '.this' inside an arrow function is the same as the value of '.this' outside the function.

Classes

In ES6 classes are just a mirage and hide the fact that prototypal inheritance is actually going on under the hood, let's quickly look at how to create a "class" with ES5 code:

Super: Keyword

super must be called before '.this' In a subclass constructor function, before '.this' can be used, a call to the super class must be made.