JavaScript is Functional: Anonymous Functions

Run Example

Not every functions deserves a name

Anonymous functions can be created on the spot and used right away

function hello(talker) { talker("Hello world"); } hello(function (text) { output('I am an anonymous function and I say: ' + text); });