Learnitweb

Author: Editorial Team

  • Index, Document and Field in ElasticSearch

    Index In Elasticsearch, an index is conceptually similar to a table in a relational database, but with important differences in how data is stored and accessed. An index represents a logical collection of related data. For example, if you are building an application that manages users, products, and orders, you would typically create separate indices…

  • Setting Up Elasticsearch and Kibana Using Docker

    In this section, we will set up Elasticsearch and Kibana using Docker. This setup is intentionally kept simple so that you can focus on understanding Elasticsearch concepts rather than spending time on complex infrastructure issues. Important Ports Used by Elasticsearch and Kibana Before running anything, it is important to understand the ports involved. Elasticsearch Ports…

  • Why do we need Elasticsearch?

    Introduction: Why Search Feels So Magical Have you ever stopped to think about what actually happens when you type something into Google and press Enter? Within a fraction of a second, you receive thousands—or even millions—of results. Not only that, but Google often starts predicting what you are about to type before you finish typing.…

  • Understanding the Microtask Queue and Why It Can Still Freeze the Browser

    In the previous tutorials, you learned that modern browsers use a combination of task queues, an event loop, and a rendering pipeline that typically runs every sixteen milliseconds. You also learned that if a task takes longer than this window, the browser is unable to update the user interface, which leads to visible freezing, unresponsive…

  • Handling Long-Running Tasks in the Browser Without Freezing the Page

    In the previous tutorial, you learned that modern browsers use an event loop, multiple task queues, and a rendering pipeline that typically runs every sixteen milliseconds in order to maintain smooth animations and responsive user interactions. You also learned that if a JavaScript task takes longer than those sixteen milliseconds to complete, the browser is…

  • Asynchronous task priorities and task queue

    In the previous lessons, we explored different ways to write asynchronous code in JavaScript, such as: All these approaches help us deal with tasks that do not complete immediately, such as API calls, timers, or user interactions. However, an important question often remains unanswered: In what order are these asynchronous operations actually executed? More specifically:…

  • Understanding Scalars and Vectors

    Introduction Linear Algebra forms the mathematical backbone of data science, machine learning, artificial intelligence, and many modern computational systems.Whenever we work with datasets, train models, or visualize information, we are implicitly working with mathematical structures such as scalars, vectors, and matrices. In this tutorial, we will focus on two foundational concepts: scalars and vectors, which…

  • async in JavaScript

    According to the definition, async is a keyword that allows an asynchronous function to be written in a way that looks synchronous. But let’s not focus on definitions too much.Instead, let’s understand what actually happens. When you place the async keyword before a function, JavaScript automatically makes that function return a promise. Even if you…

  • Promise.any()

    Revisiting the problem with Promise.race() Suppose Eugene answers in 1 second, but he doesn’t have a pen. John and Susie respond later, but they do have pens. Since Promise.race() reacts to the first settled promise, the final result becomes a rejection. Here’s how that situation looks in code: Output: Even though Susie could help, Promise.race()…

  • Understanding Promise.race() in JavaScript

    The Core Idea of Promise.race() Promise.race(): This means: Real-Life Example: Borrowing a Pen at School Let’s understand this with a simple real-world example. Imagine: Each one replies at a different speed. Their response times: Friend Response Time Has a Pen? John 3 seconds Yes Eugene 5 seconds No Susie 2 seconds Yes You don’t want…