3 ms·
JS is single threaded, but the process lives in an event loop. You can easily write a JS function that can have a race condition by launching two asynchronous
by epolanski 2y ago
JS is single threaded, but the process lives in an event loop.
You can easily write a JS function that can have a race condition by launching two asynchronous processes (such as writing to local storage in a browser or the file system both operating on the same data).
I had this happen just today while scraping different websites writing to the same files and overwriting each other.