promise

async await in javascript

Async/await in JavaScript

Async/await is an extension of promise. We use async keyword with a function to represent that the function is asynchronous. The async function returns a promise. It is also possible to use await keyword inside a async function. Javascript async keyword: Syntax: name – name of function parameter- parameter that are passed Example: Output: Async function. …

Async/await in JavaScript Read More »

Promise in JS

Promise in JavaScript

JavaScript is a single-threaded or synchronous programming language but with promises we can make it look like multi-threaded or asynchronous programming language. Imagine a function waiting for a network request to complete which takes more time. Meanwhile entire execution freezes at that time we need asynchronous operations. Prior to promises, events and callback functions are …

Promise in JavaScript Read More »