EPAM Systems Interview Question

Flatten a nested array I/P: [1,2,[3],[[4]],[[[5]]]] O/P: [1,2,3,4,5]

Interview Answer

Anonymous

Jun 3, 2021

console.log([1,2,[3],[[4]],[[[5]]]].flat(Infinity))