티스토리 뷰

공부

[Javascript] Async & Await

승가비 2022. 5. 23. 01:16
728x90

 

https://javascript.info/async-await

 

Async/await

 

javascript.info

async function f() {
  return 1;
}
async function f() {
  return 1;
}

f().then(alert); // 1
async function f() {
  return Promise.resolve(1);
}

f().then(alert); // 1
let value = await promise;
728x90
댓글
댓글쓰기 폼