js callback function options code example
Example 1: javascript callback function
const message = function() {
console.log("This message is shown after 3 seconds");
}
setTimeout(message, 3000);
Example 2: js callback function
const add = (num1, num2) => num1 + num2;
const result = (num1, num2, cb) => {
return "result is:" + cb(num1, num2);
}
const res = result(12, 13, add);