This commit is contained in:
Barney Carroll 2017-02-14 11:29:01 +00:00 committed by GitHub
parent e7f38bb3e8
commit 43fca5898f

View file

@ -635,11 +635,13 @@ greetAsync()
### `v1.x` ### `v1.x`
```javascript ```javascript
var greetAsync = new Promise(function(resolve){ var greetAsync = function(){
return new Promise(function(resolve){
setTimeout(function() { setTimeout(function() {
resolve("hello") resolve("hello")
}, 1000) }, 1000)
}) })
}
greetAsync() greetAsync()
.then(function(value) {return value + " world"}) .then(function(value) {return value + " world"})