I have a custom function and I want to add a callback function to it, i looked through the other questions but I couldn\'t really find the answer for my problem. So basically it
Here's an example with a callback with a return value that's also taking input parameters:
function test2(arg1, arg2, callback) { var result = callback(arg1, arg2); alert('arg1=' + arg1 + ', arg2=' + arg2 + ', result=' + result); } test2(1, 2, function(a, b) { return a + b; });