flatten()

Create a flattened copy of an array.

This function is valid in v2.1.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Array} array
Array to flatten.
{boolean|number=} opt_depth Optional, Default:1
If true or Infinity there will be no limit to the recursiveness of the flattening. Otherwise, if given, this should be a number indicated how many levels down this array should be flattened.

Returns

{Array}
Flattened version of array up to the given opt_depth.

Required Function

This function directly requires the following function which is included automatically:

  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.