(function test(queue) { const fn = queue.shift() fn(s => { runCallback(s) if (queue.length) test(queue) }) })([one, two, three])