Can JavaScript Do Two Things at Once?

  • In programming, doing two things at once is called concurrency
  • Whether JS can do two things at once depends on where JS starts and ends
  • Technically JavaScript cannot but the browser can**
  • Concretely, JavaScript will never run two of your functions at the same time
  • JavaScript is Single-Threaded

17 / 21