Skip to content

Instantly share code, notes, and snippets.

@ukris
ukris / parallel.js
Last active August 29, 2015 14:21 — forked from ded/parallel.js
function parallel() {
var args = Array.apply(null, arguments)
, callback = args.pop()
, returns = []
, len = 0
args.forEach(function (el, i) {
el(function () {
var a = Array.apply(null, arguments)
, e = a.shift()
if (e) return callback(e)