Javascript

JavaScript Fetch API, Async/Await

Await is syntactic sugar for Promises and is used for avoiding the multiple promise chains. It makes asynchronous code look more like synchronous code and makes it easier for humans to understand the code. A function declared with the async keyword is called an Async Function and await function is used inside the Async function.

Continue reading

Views: 671

Standard
Javascript, Programming

JavaScript Promises

A promise is a JavaScript object used to handle asynchronous operations. Before the promise was introduced in JavaScript, events and callback functions were used to handle the asynchronous events.  Promises provide a better way of handling multiple callbacks at the same time, thus avoiding the multiple nested callbacks and errors.

Continue reading

Views: 20

Standard