What is async / await ?
async/ await are two keywords, Async and Await which are used for asynchronous programming in JavaScript.
Rather than having too many nested functions, it enables readability and enhances maintainability of code and is the most recommended for development.
Async Function
An async function is a function that is written by using the async keyword.This makes the function asynchronous.
async returns a promise.
Await Function
The keyword await can be used only inside an async function. JavaScript wait until the promise is resloved or rejected.
It cannot be used in regular functions.
Here is an example using async / await to make an api call.
Async await is super simple and easy to use.
If you liked the post, please do follow me : Rhea RB.
Thank you for reading ! Happy Coding !!