In the following code, I have Array.forEach, It executes the doSomething synchronous function in sequence:
items.forEach(function(i
Unfortunately Javascript is a single threaded language. However, HTML5 aims to improve this by adding Web Workers, which allows real OS-level threads to be spawned. If you are able to leverage HTML5 then this may work for you. You would be able to spawn a Web Worker for each item then wait until all threads are complete (joined).