Created
April 27, 2018 04:56
-
-
Save rohanBagchi/85c8b1ed2fba6a3f4bf72c00e6622aef 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
| (function main() { | |
| getLargeNumber() | |
| .then(function (number) { | |
| console.log('We got ' + number); | |
| }); | |
| })(); | |
| function getLargeNumber() { | |
| return new Promise(function (resolve, reject) { | |
| setTimeout(() => { | |
| var value = Math.floor(Math.random() * 20000); | |
| resolve(value); | |
| }, 2000); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment