Asynchron Errorhandling inside $.each
问题 I am on server side Node.js and somehow caught up in the callbacks. I use the following function to insert Data in the Table with the mysql pkg: connection.query('INSERT INTO tableName SET ?', post, function(err, result) { if (err) { if (err.code === 'ER_DUP_ENTRY') { } else { throw err; } } }); I want to log how many duplicate entries are there without stoping the loop which calls this above function by an $.each. It says here that i have 3 possibilities: throw, callbacks and EventEmitter.