I know that you can either splice remove an element from an array or delete it with delete . The first approach can cause problems with concurrency, for example. if one thread moves through the array, and the other only moves or splices. delete does not have this problem if forEach is used in the array, since forEach will move through the holes in the array.
However, the array cannot continue to grow forever and will require a radical, potentially causing the same problem as in the case of splicing. It seems like I need a lock, but I would be surprised if Javascript had any possibilities for this. Any thoughts?
source share