In JavaScript, functions are objects and therefore, functions can take other functions as arguments and can also be returned by other functions.
Fig: Callback function
A callback is a JavaScript function that is passed to another function as an argument or a parameter. This function is to be executed whenever the function that it is passed to gets executed.
Leave a Reply