What's callback function?
"I will call back later!"
A JavaScript callback is a function passed as an argument to another function, which is then executed (or "called back") at a later point in time to complete a specific task.
function teamIndia(name){
console.log("Cricket");
name("Rohitsharma");
}
function playGround(player){
console.log(player + " scored a Century");
}
teamIndia(playGround);
OUTPUT: Cricket
Rohitsharma scored a century
Top comments (0)