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