Using Promise

Jeong Ha Seung·2021년 12월 1일

ES6

목록 보기
6/9
const amIsexy = new Promise((resolve, reject) => {
  setTimeout(reject, 3000, "Yes you are");
});

amIsexy
  .then((result) => console.log(result)) //성공적으로 가져오면 then이 실행되면 catch부분은 절대 실행 안됨
  .catch((result) => console.log(result)); //오류가 나면 catch만 실행하고 then은 실행 X
profile
블로그 이전했습니다. https://morethan-haseung-log.vercel.app

0개의 댓글