There is a difference programmatically and computationally, but this is not the difference that you will see when it is executed, since it is only 1ms .
I would suggest that if the timeout is set to 1ms , it pauses this script and allows other scripts to work at the same time. And, as you probably know, javascript is one-way, so that might be your reason right there.
EDIT:
Thanks to @molf, who corrected my thoughts, it would seem that setting it to 0ms is just a trick to get it working in the next tick of the event loop.
Jan Hรธjriis Dragsbaek Dec 01 2018-11-12T00: 00Z
source share