: 특정 코드의 연산이 끝날 때까지 코드의 실행을 멈추지않고 다음 코드를 먼저 실행하는 자바스크립트 특성
// #1
console.log('Hello');
// #2
setTimeout(function() {
console.log('Bye');
}, 3000);
// #3
console.log('Hello Again');
.then()으로 연결하면 된다.1. 기본
new Promise(function(resolve, reject){
setTimeout(function(){
resolve(1);
}, 1000);
}).then( res => console.log(res))
2. 함수를 미리 선언하고 이런식으로 활용 가능하다.
getData(getUserInfo)
.then(parseValue)
.then(auth)
.then(diaplay);
getData().then.catch();