Answers for "async / await in javascript"

0

async await

//used in node.js
const fetch = require('node-fetch');
async function Showuser() {
  const result = await fetch('https://jsonplaceholder.typicode.com/todos/1');
  const date = await result.json();
  console.log(date);
}

Showuser();
Posted by: Guest on August-28-2021
0

Async/Await

async function run () {
  const user = await getUser()
  const tweets = await getTweets(user)
  return [user, tweets]
}
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language