Monday, November 15, 2010

What is Lambda in Javascript?

Java Script allows passing a function as an argument to another function. This is called lambda.

Example. Following code will alert Hi.


function executeFn(fn){
fn();
}
executeFn(function(){ alert('Hi');});

No comments: