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(){
setTimeout(function() { return new Promise(function(resolve){
resolve("hello") setTimeout(function() {
}, 1000) resolve("hello")
}) }, 1000)
})
}
greetAsync() greetAsync()
.then(function(value) {return value + " world"}) .then(function(value) {return value + " world"})