📜  ejemlo async await javascript 代码示例

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

代码示例1
// Async/Await
const asyncGreeting = async () => 'Greetings';
// Promises
const promiseGreeting = () => new Promise(((resolve) => {
  resolve('Greetings');
}));
asyncGreeting().then(result => console.log(result));
promiseGreeting().then(result => console.log(result));