Home Nodejs function keeps executing even after "return callback()" is called
 In the following function, it is my understanding that the code should stop executing after the callback if either of the first two if conditions is met, i.e. if either "validate_post" returns an error or if "!clean.postId == true". When I ran into the second if condition during testing, the callback was called with the error message, however the following block (data.updatePost()) was still executed, resulting in the callback being called again. What am I doing wrong here? Thanks for your help!  var data = require('./data') var validate_post = require('./validate_post') module.exports = function(post, callback) { validate_post(post, function(err, clean) { if(err) { callback({status: "error", message: err}) return } if(!clean.postId) { console.log('first callback is called at this point') callback({status: "error", message: "Something is off here"}) return } console.log('code still executes for some reason') data.updatePost(clean.postId, clean.post, function(err, res) { if (err) { callback({status: "error", message: err}) return } console.log('callback is called a second time at this point') callback(null, {status: "success", message: res}) }) }) }