- Describe the biggest difference between
.forEach&.map. ForEach will loop through an araay and allow you to do things with each item. map will perform similar to forEach but will produce a new array. - What is the difference between a function and a method? a function is different than a method because a method is a function inside of a object. so the difference is where they are placed. a function will be outside of an object in the global scope and a method will only be functionalal from within a object.
- What is closure? the ability to make global variables local. a function with in a function
- Describe the four rules of the 'this' keyword. new (call apply bind) obj.func(), so its creating a new object, implicit or explict and the window
- Why do we need super() in an extended class? to access the inherited attributes or to establish them without the super keyword the extended class does not build upon the orginal class. like if name and age was in the parent class without the super keyword name and age would be undefined it may even not allow you to extend as i believe an error shows up requiring you to use the super keyword when extending.