Answers for "How to return values from async function"

-1

How to return values from async function

const axios = require('axios');
async function getData() {
    const data = await axios.get('https://jsonplaceholder.typicode.com/posts');
    return data;
}
console.log(getData());
Posted by: Guest on June-02-2021

Code answers related to "How to return values from async function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language