[Syntax] Async & await
Async & Await Promise 와 Callback 와 마찬가지로 자바스크립트 비동기 처리에 사용되는 객체이다. Async & Await VS Promise getDatas() 는 Promise 객체이다. Promise const datas= () => { getDatas() .then(datas => { console.log(users); return datas; }) .catch(error => { console.log(error); }); } Async & Await const datas = async() => { console.log(await getDatas()); return await getDatas(); } 둘의 차이점은 명확하다. 코드의 간결함이 남다르다. 자바와 같이 동기적 코드..
2020.09.10