means that a function can be stored in a variable, array, or object. Also, a function can be passed to, and returned from, a function. http://javascriptenlightenment.com/ var printFullName = function(fullName) { console.log(fullName); }; printFullName(printFullName);
of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. Wikipedia: http://en.wikipedia.org/wiki/Callback_(computer_programming) var printFullName = function(fullName) { console.log(fullName); }; printFullName('Grace Hopper'); var createFullNameAndPrintIt = function(first, last, callback){ var fullName = first + ' ' + last; callback(fullName); //Should really check if callback is a function }; createFullNameAndPrintIt('Grace', 'Hopper', printFullName); createFullNameAndPrintIt('Grace', 'Hopper', function(fullName){ console.log('Commander ' + fullName); });
meanings, depending on the context in which it is used. In summary: • In a method context, this refers to the object that contains the method. • In a function context, this refers to the global object. • If this is used in a constructor, the this in the constructor function refers to the object which uses the constructor function. • When the apply or call methods are used, the value of this refers to what was explicitly specified in the apply or call invocation. http://dublintech.blogspot.ie/2011/10/are-you-confused-by-this-javascript.html
parts: Douglas Crockford JavaScript Patterns: Stoyan Stefanov Learning JavaScript Design Patterns: Addy Osmani jQuery fundamentals: Rebecca Murphy Talks to help you become a better front-end engineer in 2013: Smashing Magazine Crockford on JavaScript: YUI Blog