In JavaScript, functions are objects. Because of this, functions can take functions as arguments and can be returned by other functions. Functions that do this are called higher-order functions. Any function that is passed as an argument is called a callback function. So, we can use it as a variable like Strings and Objects. If they are variables, then we can do the following with them.
A function that is passed to another function as an argument and the given function is executed inside the otherFunction. That parameterized function is called as Callback. We have used callbacks many times especially in jQuery where we listen from the DOM event and pass the callback to that function. For example
#javascript #jquery #callback