My Blog

My WordPress Blog

My Blog

My WordPress Blog

8. Asynchronous

setInterval() Method

JavaScript setInterval() Method In JavaScript, the setInterval() is a window method that is used to execute a function repeatedly at a specific interval. The setTimeout() Method allows you to execute the function only once after the specified time. The window object contains the setInterval() method. However, you can execute the setInterval() Method without taking the […]

Timing Events

What are the Timing Events? JavaScript timing events are used to execute the code after a specified time only once or multiple times. In JavaScript, you can use the timing events to control when a particular task should be executed. The ‘window’ object contains the various methods for timing events, which you can use to […]

Promises Chaining

The promise chaining in JavaScript can handle multiple related asynchronous operations even with a single promise. While a single promise handles a single asynchronous operation, the promise chaining allows you to create a sequence of promises. Here success or rejection of one promise triggers the execution of the next promise. This enables you to handle multiple asynchronous operations. In […]

Promisification

Promisification in JavaScript Promisification in JavaScript is a concept to convert the callback functions into a regular function, returning the promise. The reason to convert the callback functions into promises is that when you need to write the nested callback functions, it increases the complexity of the code. So, you can write a function returning […]

Microtasks

Microtasks in JavaScript are small functions that are executed after the completion of the function or program code that creates them and if the JavaScript execution stack is empty. Microtasks are executed before any macrotasks, such as setImmediate() and setTimeout(). Microtasks are used to implement features such as promises. JavaScript is a single-threaded programming language. […]

Async/Await

The JavaScript functions defined with the async/await keyword can perform the same task as promises with fewer lines of code, and it makes the code readable. The promise’s syntax is a bit complex, so the async/await syntax is introduced. To use async/await, we need to define an aync function first. For this we write async before function […]

Promises

What is Promise in JavaScript? A JavaScript promise is an object that represents the completion or failure of an asynchronous operation. It employs callback functions to manage asynchronous operations, offering a easier syntax for handling such operations more easily. A promise object can created using the Promise() constructor. The promise constructor takes a callback function […]

Asynchronous JavaScript

Asynchronous JavaScript is a programming technique that enables your program to start a potentially long-running task and continue to executing other tasks parallelly. JavaScript is a single-threaded programming language. It means you can execute a single script or particular code at a time. JavaScript control flow moves the line by line and executes each line […]

Scroll to top