Anonymous functions in JS

An anonymous function is a function without a name. An anonymous function is often not accessible after its initial creation. Here is an example of an anonymous function expression (the name is not used):

var myFunction = function() { statements }

It is also possible to provide a name inside the definition in order to create a named function expression:

var myFunction = function namedFunction(){ statements }

Last updated