Web APIs

Javascript is a single threaded language that has to do things in the order they come in – but also it can do things asynchronously. How? That’s where Web APIs come in.

These APIs are not part of the JavaScript language, but they are provided by the Javascript runtime environment. One of these environments you’re using right now to read this – the browser! The other environments are something like Node.js which we will cover later.

Web APIs is an umbrella term for specific APIs that allow for things like fetching data from a server, or allowing the app to wait on user interactions or even getting a user’s geolocation.

To understand the event loop, we need to know about:

Call Stack

Web APIs / Background APIs

Callback Queue (Task Queue)

Microtask Queue

The Event Loop itself


Posted

in

, ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *