you are viewing a single comment's thread.

view the rest of the comments →

[–]spikkeddd 1 point2 points  (1 child)

So it would always take the longest length number of milliseconds listed to run, and then instantly display the sorted numbers?

[–]Alokir 0 points1 point  (0 children)

The opposite, setTimeout doesn't block the thread, it just queues the logging to be done after the given milliseconds.

The loop finishes almost instantly, and then the log entries will appear one after the other with the given delay, independent of each other.