I am trying to understand Callback Functions and am a bit confused. Now, if I pass 3 or more functions in the parameters and then call them one after another, as in below example, then will they all be called Callback Functions? or the parent will be known as Callback Function? or Both will together be called as Callback Functions?
Also, I have never heard that a function having more than 1 callbacks. So, is this example a correct reference of such example ... and so, will it be correct to say - A function can have infinite no of callbacks? Kindly, verify and explain!
function alpha(a, b,
fn1 = ()=>{
console.log("hello");
},
fn2 = () => {
console.log("good morning")
},
fn3 = () => {
console.log("good evening")
}){
console.log(a, b, a+b);
fn1();
fn2();
fn3();
}
alpha(5, 10);
Reference: