Concepts in JavaScript
JavaScript is by default synchronous. when running a script works for one thing at a time.
Typically, two ways programs
blocking (“asynchronous”)
• Easy to write
• Uses multi-threading
• Memory and context-switching overhead
non-blocking/event-loop (“synchronous”)
• Single-threaded
• High-concurrency with low-memory consumption
• Great for UI and 10-bound services rather than CPU-
bound

*All modern JavaScript engines use the non-blocking/eventloop(“synchronous”) approach.