well u can do concurrency with Promise.all, Javascript is single-threaded but concurrency is different from parallelism. It can also be useful especially when you have blocking calls such as waiting for an API response or read/write blocking etc. That being said, it's an advanced concept that my curriculum at university didn't teach until 2nd-3rd year.
With this attitude I expect there are lots of race conditions and memory leaks in your JS. Yes these things can easily happen in a single threaded, garbage collected environment
0
u/[deleted] Jun 20 '22
[deleted]