Skip to content

Instantly share code, notes, and snippets.

@joshkehn
Created August 22, 2011 15:29
Show Gist options
  • Save joshkehn/1162669 to your computer and use it in GitHub Desktop.
Save joshkehn/1162669 to your computer and use it in GitHub Desktop.
var arr = // array of objects;
res = [];
arr.forEach(function (item) {
item.save(function (err) {
res.push(err);
if (res.length === arr.length)
{
// Done
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment