What does it mean to flatten an array?
id:153Flattening an array means to take an array of nested arrays, ie a multidimensional array, and reduce it to a single dimension array. arr1.flat(2) The flat method takes as an argument the depth of dimensions which need to be flattened.