![]() |
VOOZH | about |
Lodash _.flatten() method is used to flatten the array to one level deep and it returns a new flattened array.
_.flatten( array );Example 1: In this example, er are flattening the array to a single level by the use of the _.flatten() method.
Output:
👁 ImageExample 2: In this example, er are flattening the array of object to a single level by the use of the _.flatten() method.
Output:
👁 ImageExample 3: In this example, er are flattening the empty array to a single level by the use of the _.flatten() method.