Understanding JavaScript Async: From Callbacks to Promises and the Event Loop
Callbacks
A Callback is a function that is passes as an argument to another functions.
function fetchData(callback) {
setTimeout(() => {
console.log("Data fetched");
callback();
async-js-callbacks-promises.hashnode.dev3 min read