CallBack Functions in JavaScript

PUSHAN VERMA - Jul 5 '22 - - Dev Community

Callback Functions:let me explain to you in simple words .We call the second function through first function which takes second function as argument in 1st .

function printFirstName(firstname,cb)
{
console.log(firstname);
cb("Verma");
}

function printLastName(lastname)
{
console.log(lastname);
}

printFirstName("pushan",printLastName);

Image description

. . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player