Is JavaScript guaranteed to be single-threaded?

后端 未结 12 1644
遇见更好的自我
遇见更好的自我 2020-11-21 06:38

JavaScript is known to be single-threaded in all modern browser implementations, but is that specified in any standard or is it just by tradition? Is it totally safe to assu

12条回答
  •  一生所求
    2020-11-21 06:55

    @Bobince is providing a really opaque answer.

    Riffing off of Már Örlygsson's answer, Javascript is always single-threaded because of this simple fact: Everything in Javascript is executed along a single timeline.

    That is the strict definition of a single-threaded programming language.

提交回复
热议问题