Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.06 KB

Answers.md

File metadata and controls

21 lines (16 loc) · 1.06 KB

Your responses to the short answer questions should be laid out here using Mark Down.

  1. Describe the biggest difference between .forEach & .map. -.forEach does not return a new array, it loops through. -.map returns a new array, resulting in a new array.

  2. What is the difference between a function and a method? -A method is used in a object. -a function passes through data and called be called by name.

  3. What is closure? -A closure is a function inside of a function that has access to it's own scope.

  4. Describe the four rules of the 'this' keyword.

    • Window - When a function is contained in a global scope.

    • . notation is the object before the ., the this key word points to the object.

    • new - the new keword invokes a function which results to the child inheirting the parent.

    • the call and apply method when invoked with the keyword this points to whats inside the parentheses.

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

    -super() is used to call and inheirent the parent object.