Multiple callbacks in same async function?
Problem
If you have more than one Callback in an asynchronous Function, will it exit the function on the first execution of a callback, similar to a return statement, or will it continue on?
function handler(conn, callback){
if (conn === true){
callback('found');
}
callback('not found');
});
Problem courtesy of: gjw80
Solution
Yes, it will continue on, unless you return callback()
Solution courtesy of: thiago.lenz
Discussion
View additional discussion.