javascript Promise

기본 형태 //resolve 로 정상일 경우 new Promise(function(resolve, reject) { resolve('hello'); //goto then() }).then(function(result){ console.log("success : "+ result); // success : hello }).catch(function(result){ console.log("failed : "+ result); }); //reject 로 실패일 경우 new Promise(function(resolve, reject) { reject('hello'); //goto catch() }).then(function(result){ console.log("success : "+ result); }).catch(function(result){ console.log("failed : "+ result); // failed : hello }); 함수형으로 … 계속 읽기 javascript Promise