function firstFunction(_callback){
// do some asynchronous work
let x= _callback(20);
console.log("x=>",x)
console.log("fahm")
}
function secondFunction(){
// call first function and pass in a callback function which
// first function runs when it has completed
firstFunction(function(a) {
let x=0;
for (i=0; i<a; i++) {
x=x+1
}
return x;
})
}