From f32adac7dc2a0b6e0a213e3167b3cf1199aabd1e Mon Sep 17 00:00:00 2001 From: Ayush Singh Date: Wed, 23 Jun 2021 16:55:08 +0530 Subject: [PATCH] Fixed #Q14 nested array flattening --- challenges/collections-challenges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/collections-challenges.md b/challenges/collections-challenges.md index a1055bf..a846fb0 100644 --- a/challenges/collections-challenges.md +++ b/challenges/collections-challenges.md @@ -344,7 +344,7 @@ function flat(arr){ const flatArr = []; arr.forEach((value) => { if(Array.isArray(value)){ - flat(value); + flatArr.push(...flat(value)); } else{ flatArr.push(value);