Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

callback in javascript

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);
})
 
PREVIOUS NEXT
Tagged: #callback #javascript
ADD COMMENT
Topic
Name
5+4 =