Callback function : A function passes as argument into another function is called callback function.
Higher order function : A function which receives a callback function is called higher order function.
Example :
function foo(){
console.log("Hello World");
}
function abu(e){
e();
}
abu(foo);
In this example abu()
and foo()
are higher order function and callback function respectively.
Top comments (2)
Welcome to DEV. You could add syntax highlighting to your code by adding the language after the first triple backticks:
will result in this:
Wow!! Nice idea. Thanks for sharing 🥰