Callbacks in JavaScript: Why They Exist
A callback is a function you pass into another function so that it can decide when to run it. Not immediately Only when the outer function chooses.
function greet(name) {
return `Hello, ${name}`;
}
jswithrachit.hashnode.dev2 min read