Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create callback function javascript

function add(a, b, callback) {
  if (callback && typeof(callback) === "function") {
    callback(a + b);
  }
}

add(5, 3, function(answer) {
  console.log(answer);
});
 
PREVIOUS NEXT
Tagged: #create #callback #function #javascript
ADD COMMENT
Topic
Name
9+8 =