Ask HN: Does JavaScript have race conditions?
During an interview, I was asked how to avoid race conditions in JavaScript. When I explained why JS did not have race conditions(single threaded event loop) the interviewer looked unhappy. I googled and received mixed answers. Some say yes while others say no. Any experts here can help me with this confusion?
3 comments
[ 3.4 ms ] story [ 19.0 ms ] threadBut 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.