Skip to content

Commit 5a46f7b

Browse files
authored
Merge pull request sadanandpai#26 from ayush013/main
Fixed #Q14 nested array flattening
2 parents 0476359 + b068008 commit 5a46f7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

challenges/async-challenges.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ In the 2nd solution, recursive setTimeout is used.
112112
const num1 = 1, num2 = 10;
113113
let i = num1;
114114
const intervalId = setInterval(() => {
115-
console.log(++i);
116-
if (i === num2)
115+
console.log(i++);
116+
if (i === num2 + 1)
117117
clearInterval(intervalId);
118118
}, 1000);
119119
```

challenges/collections-challenges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ function flat(arr){
344344
const flatArr = [];
345345
arr.forEach((value) => {
346346
if(Array.isArray(value)){
347-
flat(value);
347+
flatArr.push(...flat(value));
348348
}
349349
else{
350350
flatArr.push(value);

0 commit comments

Comments
 (0)