Created
December 26, 2018 23:40
-
-
Save svngoku/3b10e83c3c938182884e3756d3ffd222 to your computer and use it in GitHub Desktop.
Promise created by svngoku - https://repl.it/@svngoku/Promise
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
| /* Promise : This code print the first and the second value */ | |
| const p = Promise.resolve('hello') | |
| p.then(val => { | |
| console.log(val) | |
| return `${val} world` | |
| }).then(newVal => { | |
| console.log(newVal) | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
return Hello in the first printing and Hello World after