JavaScript Libraries

Books

Functions

Anonymous function

var plus = function(a,b){
  return a+b;
};
plus(2,3);
 
var plus = function(a,b){
  return a+b;
}(2,3);

Arguments parameter

Call and Apply function invocation

var speak = function(what){
  alert(this.love); // says "purr"
  alert(what); // says "Tuna"
};
var saySomething = {normal: "meow", love: "purr"};
speak.call(saySomething, "Tuna");


var speak = function(what){
  alert(this.love); // says "purr"
  alert(what); // says "growl"
};
var saySomething = {normal: "meow", love: "purr"};
speak.apply(saySomething, ['growl']);

JavaScript Design Patterns

JavaScript with HTML5 or Canvas