Callback Functions

Callback functions are everywhere in JavaScript.
There are two types of callback and they have important differences
Synchronous -
Asynchronous -


A function that accepts another function as an argument is called a higher order function.
The callback function is passed as an argument to the higher order function which then invokes the callback function to perform the operation.
A callback function can be created as a regular named function or anonymously using an arrow function.
If you have defined a function which you are supplying as an argument to another function then you are creating a callback function.


array.map

map(array, callback) is an example of a higher order function




© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext