📜  如何从异步函数返回值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:05.728000             🧑  作者: Mango

代码示例1
const axios = require('axios');
async function getData() {
    const data = await axios.get('https://jsonplaceholder.typicode.com/posts');
    return data;
}
console.log(getData());