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
function myfunction(callback) {
// something
callback();
}
myfunction(callback);
notice I am not invoking the callback but just passing it as a function reference to my function. I then invoke it IN the function at the end or wherever you want to do it.