-
Describe the difference between .forEach() and .map()
- .map() returns a new array with the modified items while .forEach() doesn't.
-
What is the difference between a function and a method?
- Functions are defined outside of clases while methods are defined inside of a class or as part of it.
-
What is closure?
- Its an inner function that has acess to the outside scope.
-
Describe the four rules of the .this() keyword?
-
Window/Global Binding: Binds to the most global window.
-
Implicit Binding: Binds the object that is left to the dot of the function called.
-
New Binding: Links a new object that is left to the dot of the function called.
-
Explicit Binding: 'this' is assigned via .call(), .apply() and .bind()
-
-
Why do we need super() in an extended class
- Passes new attributes back to the constructor of the parent object.