How could something equivalent to lock in C# be implemented in JavaScript?
lock
So, to explain what I\'m thinking a simple use case is:
User clicks
I've had success mutex-promise.
I agree with other answers that you might not need locking in your case. But it's not true that one never needs locking in Javascript. You need mutual exclusivity when accessing external resources that do not handle concurrency.