Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 899 Bytes

File metadata and controls

29 lines (17 loc) · 899 Bytes
  1. Describe the difference between .forEach() and .map()

    • .map() returns a new array with the modified items while .forEach() doesn't.
  2. 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.
  3. What is closure?

  • Its an inner function that has acess to the outside scope.
  1. 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()

  2. Why do we need super() in an extended class

    • Passes new attributes back to the constructor of the parent object.