First question is: What are callback functions?
Second question: How this code works and how it gets executed in JavaScript behind the scene?
The code:
// callback functions
const perOne = (friend, callfrnd) => {
console.log(`I am busy right now. I am talking to ${friend}`);
callfrnd();
};
const perTwo = () => {
console.log(`Ok i will callback u later.`);
};
perOne("Kartik", perTwo);