function add(a, b, callback) { if (callback && typeof(callback) === "function") { callback(a + b); } } add(5, 3, function(answer) { console.log(answer); });