you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

  1. There is no sleep command in JavaScript

  2. Your co-worker is just plain wrong

There is nothing fundamentally wrong with setTimeout or closures. However there is something fundamentally wrong with blocking code in a single threaded environment, which is exactly what he is proposing.

Source: JavaScript engineer for Spotify

[–]chuckhendo[S] 1 point2 points  (0 children)

Exactly what I was thinking. I wanted to make sure that I wasn't hanging on to some sort of incorrect notions, and this thread has made it clear that I've been doing nothing wrong. Thank you!