JavaScript thrives on events and asynchronous tasks. Amid its many features, callbacks quietly shape how we write non-blocking code. Yet, many overlook how crucial they are for flow control and error handling in async operations. Have you ever wonder...
These four concepts are commonly used in React development and modern JavaScript. This article explains each of them step-by-step with 3 real-life examples per topic, using simple English so both beginners and working professionals can learn easily. ...
Functions with callbacks have played a significant role in many reentrancy attacks, a common vulnerability in smart contracts. In this article, we will discuss the topic and explore how callbacks can contribute to reentrancy attacks, how these attack...
hey folks let’s understand callbacks in a easy way. we use callbacks to save ourselves from DRY(don’t repeat yourself) problem like we can understand from a example: LIFE BEFORE CALLBACK function square(n){ return n*n; } function cube(n){ r...
Assume that you have a C function that accepts another function as an argument, mostly known as a callback. This is used to delegate processing data from one function to another, without pre-defining how that other function will work. Ex-post, the de...
JavaScript is a flexible language, allowing functions to be assigned to variables, passed as arguments, and even returned from other functions. This capability is made possible because JavaScript treats functions as first-class citizens. But what doe...
JavaScript, by design, is a single-threaded language 🧵. This means it can only execute one task at a time. However, many modern applications require operations like network requests 🌐, file handling 📁, or database queries 🗄️, which can take time ...
The past week has been all about diving deep into JavaScript, pushing through challenges, and coming out with a much clearer understanding of the language. As someone who enjoys working with technologies and solving problems, I wanted to share my exp...
Introduction JavaScript is a single-threaded, asynchronous programming language. While its synchronous nature can make things simpler, handling long-running operations (like network requests or file reads) requires a non-blocking approach. Enter call...
Asynchronous Programming allows to perform tasks that takes time to execute (such as fetching data from a server or reading files) without blocking the execution of other code. Instead of waiting for a task to complete, the code moves on to other tas...