refactoring, modules
This commit is contained in:
parent
b8f6d96990
commit
a16814aaf1
112 changed files with 484 additions and 1825 deletions
|
@ -0,0 +1,3 @@
|
|||
The output is: `1`.
|
||||
|
||||
The second call to `resolve` is ignored, because only the first call of `reject/resolve` is taken into account. Further calls are ignored.
|
15
1-js/09-async/02-promise-basics/01-re-resolve/task.md
Normal file
15
1-js/09-async/02-promise-basics/01-re-resolve/task.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
# Re-resolve a promise?
|
||||
|
||||
|
||||
What's the output of the code below?
|
||||
|
||||
```js
|
||||
let promise = new Promise(function(resolve, reject) {
|
||||
resolve(1);
|
||||
|
||||
setTimeout(() => resolve(2), 1000);
|
||||
});
|
||||
|
||||
promise.then(alert);
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue