Even though there is an apparent shift in the creation of web applications resembling desktop applications more and more, due to security concerns native applications will always have more control over the system and this includes the choices for threading. If not, you're essentially writing a new operating system but now in a browser, following the (too often seen) anti pattern of implementing the same functionality already available but then on a higher level, only resulting in performance loss.
JavaScript for web development should merely be a scripting language, augmenting the functionality of your web page. If, for performance reasons, you require multiple threads then switch to a native app.
Furthermore, if JS is only used to augment the functionality of a page, the costs of the theoretical concurrency issues are negligible and a mere check for whether the sound has been played, if not play the sound and set a flag, if not do nothing should suffice and be correct in the overwhelming majority of cases.
The point of this post is that they've already gone down the rabbit hole of concurrent programming, but none of the standard tools for it are provided.
Performance is irrelevant here. Concurrency isn't being used as a performance tool, it's happening as a consequence of the user's actions. The programmer doesn't want it, but they have to deal with it.
Even though there is an apparent shift in the creation of web applications resembling desktop applications more and more, due to security concerns native applications will always have more control over the system and this includes the choices for threading. If not, you're essentially writing a new operating system but now in a browser, following the (too often seen) anti pattern of implementing the same functionality already available but then on a higher level, only resulting in performance loss.
JavaScript for web development should merely be a scripting language, augmenting the functionality of your web page. If, for performance reasons, you require multiple threads then switch to a native app.
Furthermore, if JS is only used to augment the functionality of a page, the costs of the theoretical concurrency issues are negligible and a mere check for whether the sound has been played, if not play the sound and set a flag, if not do nothing should suffice and be correct in the overwhelming majority of cases.