4 ms·
Yes, (in my view) you can have race conditions any time asychronous operations (like network requests) finishing in different orders results in unexpected state
by eschutte2 10y ago
Yes, (in my view) you can have race conditions any time asychronous operations (like network requests) finishing in different orders results in unexpected state. You don't get the specific type of race condition caused by interleaved multi-threaded code though. So it depends on how restrictive your definition of a race condition is. (Those races belong to the system as a whole, so are arguably not "in JavaScript.")
But since that's possible in basically all languages, I think your answer is more responsive to a question about race conditions and JavaScript. If the interviewer didn't like it, he/she could have dug into the issue more.