main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
575 bytes
|
Line | |
---|
1 | import baseFlatten from './_baseFlatten.js';
|
---|
2 |
|
---|
3 | /** Used as references for various `Number` constants. */
|
---|
4 | var INFINITY = 1 / 0;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Recursively flattens `array`.
|
---|
8 | *
|
---|
9 | * @static
|
---|
10 | * @memberOf _
|
---|
11 | * @since 3.0.0
|
---|
12 | * @category Array
|
---|
13 | * @param {Array} array The array to flatten.
|
---|
14 | * @returns {Array} Returns the new flattened array.
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * _.flattenDeep([1, [2, [3, [4]], 5]]);
|
---|
18 | * // => [1, 2, 3, 4, 5]
|
---|
19 | */
|
---|
20 | function flattenDeep(array) {
|
---|
21 | var length = array == null ? 0 : array.length;
|
---|
22 | return length ? baseFlatten(array, INFINITY) : [];
|
---|
23 | }
|
---|
24 |
|
---|
25 | export default flattenDeep;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.