Example of JavaScript coroutines in the browser