A function literal is defined in an expression, as opposed to being a standalone function. The biggest difference between a function literal and a function is that a function literal is not reusable. Following is an example of a function literal: Sqr = function(z) { return this.z * z; };
|