We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 271ad9c commit 6bad396Copy full SHA for 6bad396
challenges/async.md
@@ -1221,14 +1221,14 @@ PromiseAll([
1221
```js
1222
// asynchronous helper function returning a promise which gets resolved after the specified delay with data
1223
function asyncFunc(data, delay){
1224
- return new Promise(resolve => setTimeout(()=> resolve(data), delay));
+ return new Promise(resolve => setTimeout(resolve, delay, data));
1225
}
1226
1227
function* gen() {
1228
// async function
1229
const num1 = yield new asyncFunc(2, 1000);
1230
const num2 = yield new asyncFunc(1, 2000);
1231
- console.log(num1 + num2);
+ console.log(num1 + num2); // 3 (2 + 1)
1232
1233
1234
function executeGeneratorWithPromise(gen) {
0 commit comments