function abc(){
console.log("Delieverd food order: ",orderNumber);
}
function placeOrder(orderNumber){
console.log("Customer: ", orderNumber);
cookAndDeliverFood(abc);
}
fucntion cookAndDeliverFood(callback){
setTimeout(callback,5000);
}
//Simulate users webrequests
placeOrder(1);
placeOrder(2);
placeOrder(3);
placeOrder(4);
placeOrder(5);
This is giving me syntax error. Can anyone explain the reason?
fucntion!==functionorderNumberis not in scope inabc. It will beundefined.console.log("Customer: ", orderNumber);have comma in it. Please replace it with plus (+).console.logprints all of its parameters as space-separated strings, so alternatively they could just remove the space after the colon.fucntion cookAndDeliverFood()should befunction cookAndDeliverFood. it may be a typo.