Problem Statement
How do we implement async in Node.js?
Explanation
You can write async functions using `async` and `await`. The function waits for a Promise to resolve before executing the next line, making async code easy to read and debug.
Code Solution
SolutionRead Only
async function getData(){
const res=await fetch('https://api.com');
const data=await res.json();
console.log(data);
}