Fix #1627
This commit is contained in:
parent
e7f38bb3e8
commit
43fca5898f
1 changed files with 7 additions and 5 deletions
|
|
@ -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"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue