Callback function vs Higher Order Function

mahin678

Mahin Tazuar

Posted on February 6, 2022

Callback function vs Higher Order Function

A higher-Order function is a very common and advanced concept in javascript. Actually, the function is like a first-class citizen in javascript. because a function can be stored inside a variable and take argument do the logical expression. So we can say, the callback function is which function takes a function an as argument and the argument function is called a callback function. Programmer can be using this callback function where he needed.

const heigherOrderfunction = (nms,callback) => {
   return callback(nms);
}
function callback(x){
return 'player name is'+x;
}
console.log(heigherOrderfunction ("Rose", callback))
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
mahin678
Mahin Tazuar

Posted on February 6, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related