-
Describe the biggest difference between
.forEach&.map. -.forEachdoes not return a new array, it loops through. -.mapreturns a new array, resulting in a new array. -
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.
-
What is closure? -A closure is a function inside of a function that has access to it's own scope.
-
Describe the four rules of the 'this' keyword.
-
Window - When a function is contained in a global scope.
-
.notation is the object before the., thethiskey word points to the object. -
new- thenewkeword invokes a function which results to thechildinheirting theparent. -
the
callandapplymethod when invoked with the keywordthispoints to whats inside the parentheses.
-
-
Why do we need super() in an extended class?
-
super()is used to call and inheirent the parent object.