JavaScript concurrency object