Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Latest commit

 

History

History
34 lines (22 loc) · 1.76 KB

File metadata and controls

34 lines (22 loc) · 1.76 KB

Lesson 6: functions

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

<= 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 functions 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

Classes in ES6 are just a mirage and hide the prototype inheritance 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.