mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Bump to v3.0.0.
This commit is contained in:
21
array/flattenDeep.js
Normal file
21
array/flattenDeep.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import baseFlatten from '../internal/baseFlatten';
|
||||
|
||||
/**
|
||||
* Recursively flattens a nested array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to recursively flatten.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
*
|
||||
* _.flattenDeep([1, [2], [3, [[4]]]]);
|
||||
* // => [1, 2, 3, 4];
|
||||
*/
|
||||
function flattenDeep(array) {
|
||||
var length = array ? array.length : 0;
|
||||
return length ? baseFlatten(array, true) : [];
|
||||
}
|
||||
|
||||
export default flattenDeep;
|
||||
Reference in New Issue
Block a user