1doSomething()
2.then(function(result) {
3 return doSomethingElse(result);
4})
5.catch(failureCallback);
1new Promise( (res, rej) => {
2 setTimeout(() => res(1), 1000);
3}).then( (res) => {
4 console.log(res); // 1
5 return res*2
6}).then( (res) => {
7 console.log(res); // 2
8});
9