1var deepFlatten = function (array){
2 return array.reduce(function(r, e) {
3 return Array.isArray(e) ? r.push(...deepFlatten(e)) : r.push(e), r
4 }, [])
5};
6
7console.log(deepFlatten([]))
8console.log(deepFlatten([1, 2, 3]))
9console.log(deepFlatten([[1, 2, 3], ["a", "b", "c"], [1, 2, 3]]))
10console.log(deepFlatten([[[3], [4], [5]], [9], [9], [8], [[1, 2, 3]]]))