arrays.flat flat(array, [depth=1]) Flat flattens an array of nested arrays Arguments array (Array): input array [depth=1] (number): depth of array elements to flat Returns (Array): the flattened array Example const result = arrays.flat([1, [2, [3, [4]]]]); console.log(result); > [1, 2, [3, [4]]]