Answers for "how to use await in javascript"

1

javascript await

await Promise(resolve => setTimeout(resolve, ms));

//or

(async () => {
await Promise(resolve => setTimeout(resolve, ms));
})();
Posted by: Guest on December-28-2021
16

async awiat

const data = async ()  => {
  const got = await fetch('https://jsonplaceholder.typicode.com/todos/1');
  
  console.log(await got.json())
}

data();
Posted by: Guest on July-24-2020
3

await javascript

If the value of the expression following the await operator is not a Promise, it's converted to a resolved Promise.
Posted by: Guest on April-14-2021
0

await javascript

The await operator is used to wait for a Promise. It can only be used inside an async function within regular JavaScript code; however it can be used on its own with JavaScript modules.
Posted by: Guest on April-14-2021
-2

async await in javascript

aync
Posted by: Guest on November-30-2021

Code answers related to "how to use await in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language