Last active
October 13, 2019 15:04
-
-
Save lethern/b90c10c0a33a7f9025f59ebd95f403b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let p = new Promise((resolve, reject) => resolve() ) | |
| .then( () =>{ | |
| let ARR = [0]; | |
| return ARR; | |
| }) | |
| .then( (ARR) =>{ | |
| ARR.push(1); | |
| let p_inner = new Promise( | |
| (inner_resolve, inner_reject) =>{ | |
| ARR.push(2); | |
| inner_resolve(ARR); | |
| }) | |
| .then( (ARR) =>{ | |
| ARR.push(3); | |
| return ARR; | |
| }) | |
| .then( (ARR) =>{ | |
| let double_nested = new Promise((resolve, reject) => resolve() ) | |
| .then( () => { | |
| ARR.push(4); | |
| return ARR; | |
| }) | |
| return double_nested; | |
| }) | |
| .then( (ARR) =>{ | |
| ARR.push(5); | |
| return ARR; | |
| }) | |
| .catch( (result) => | |
| 'err ' + result | |
| ); | |
| return p_inner; | |
| }) | |
| .then( (result) => | |
| console.log(result) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment