Not all tasks are synchronous, many of them take time to execute and are uncertain about the time it takes to complete the execution. Obtaining data from a database, calling a third-party API, reading data from a file, waiting for a big algorithm to complete is an example of such tasks. This series is the compilation of techs and features of JavaScript for understanding how JavaScript deals with async operations.
Nobody wants their relationship or JavaScript to look like hell, not a relationship advisor though but can talk about JavaScript for an hour or so. Legend says, crush never callback; there is no more to it and I am not a legend so let us focus on something which can be answered, JavaScript callbacks their heaven and hell.
One way to get rid of your crush or JavaScript’s callback hell is to make promises. Now there are dozens of quotes revolving about broken promises in love; but thankfully JavaScript handles promises elegantly. Let us dig more into this topic and understand how difficult or easy it is to make promises in love or JavaScript.
It is very difficult to wait on someone's loving promises, but not in JavaScript; thanks to the async/await creamy syntactic sugar made available in JavaScript for Promises. In this article, we will see the evolution of writing promises, from then() and catch() methods to super awesome async/await syntax.
December 31, 2020
October 19, 2020
March 02, 2022