In JS, without worker threads or similar situations, you don't have real race conditions. Therefore, concurrency primitives like mutexes, read/write locks, condition variables, barriers, semaphores, etc. are not necessary. Or Go-like channels.
You can use a global variable and it will be fine because it won't be accessed simultaneously.
So then how is this not cargo culting Go? imitating the observable parts of Go without truly understanding what it does?
You can use a global variable and it will be fine because it won't be accessed simultaneously.
So then how is this not cargo culting Go? imitating the observable parts of Go without truly understanding what it does?