For help with markdown syntax Go here
-
.forEach executes a function for each item in an array and doesn't create a new array. .map does the same, but returns a new array with the functions executed on each item.
-
Strings, numbers, arrays, objects, functions(?), variables(?). Arrays seem special to me due to their large amount of built in .prototype methods, such as .forEach and .reduce. They seem to lend themselves to be easy to loop over.
-
Closure is the concept that you can access information (specifically variables?) from outside a function in javascript. This is because the function will "search" for the variable until it hits the global window. Example:
var imGlobal = "Global boi"
function wheresGlobal(){ console.log("heres global: " + imGlobal); }
wheresGlobal();
-
-
Global .this, where if used not within an object gives the closest object, which would be the global window. (is this a correct way of thinking about it?)
-
Used with dot notation, i.e Implicit Binding.
-
Used with the new keyword, as a constructor function.
-
Used with .call or .apply. (Not sure of the differences between 3 and 4, as don't you need to use the new keyword to be able to use jerry.speak.call(newman) in the example?)
-