JSFiddle - React, Tailwind, and code Playground
JavaScript
//the callback function
function done(){
console.log("Done");
}
//the parent function
function increment(num, callBack){
for(var i = 0; i <= num; i++){
console.log(i);
}
return callBack();
}
//the callback function is passed to the increment function
increment(10, done);