function sum(num1,num2,callback){ let total = num1 + num2 callback(total) } sum(10,20,function(total){ // received total here console.log(total); }) sum(5,16,(total)=>{ console.log(total); })