Introduction

[Javascript is single-threaded and synchronous](https://stackoverflow.com/questions/2035645/when-is-javascript-synchronous#:~:text=JavaScript is always synchronous and single-threaded.&text=JavaScript is only asynchronous in,the callback will run synchronously.), but it allows you to write async code.

Async programming in JS still runs your code in order, but it has features that allow:

We have seen event callbacks in Node's server listen and Express' route handlers.

router.get("/users", CALLBACK_FUNCTION);

server.listen(port, CALLBACK_FUNCTION);

When client sends a "GET /users" request, call back this function

When server starts listening, call back this function

In this chapter, we'll look at the fundamentals of async programming:

Terminologies