The Event Loop Javascript

do node and web apis such as setTimeout and setInterval have their own threads ??

1 Like

According to the node documentation β€œthe event loop is what allows Node.js to perform non-blocking I/O operations β€” despite the fact that JavaScript is single-threaded β€” by offloading operations to the system kernel whenever possible.” So more or less the javascript is running in a single thread, but the event loop allows for non-blocking operations to take place. For more detail, check out the Node.js Event Loop documentation.