Answers for "console log return from async"

0

console log return from async

import axios from 'axios';

async function getItems() {
  const response = await axios.get(SOME_URL);
  console.log('done', response);
  return response;
}

getItems().then(items => console.log('items: ', items))
Posted by: Guest on August-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language