Anonymous Function
Callback as an Arrow Function
If you prefer, you can also write the same callback function as an ES6 arrow function, which is a newer type of function in JavaScript:
Anonymous Function
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):
It is also possible to provide a name inside the definition in order to create a named function expression:
Last updated