DEV Community

Cover image for API, event loop stack and queue,DOM
Sarmin Akter Dipty
Sarmin Akter Dipty

Posted on

1

API, event loop stack and queue,DOM

Image description

More Javascript
What is an API?

An API (Application Programming Interface) is a set of functions that allows applications to access data and interact with external software components, operating systems, or microservices.
GET – Gathers information (Pulling all Coupon Codes)
PUT – Updates pieces of data (Updating Product pricing)
POST – Creates (Creating a new Product Category)
DELETE – (Deleting a blog post)
How Javascript works event loop stack and queue
The Event Loop has one simple job — to monitor the Call Stack and the Callback Queue. If the Call Stack is empty, the Event Loop will take the first event from the queue and will push it to the Call Stack, which effectively runs it. Such an iteration is called a tick in the Event Loop.
What is DOM
The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document
For example, the DOM specifies that the querySelectorAll method in this code snippet must return a list of all the

elements in the document:
const paragraphs = document.querySelectorAll("p");
// paragraphs[0] is the first

element
// paragraphs[1] is the second

element, etc.
alert(paragraphs[0].nodeName);

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay