mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 12:27:49 +00:00
Fixes #436 -- document the second argument to _.flatten
This commit is contained in:
10
index.html
10
index.html
@@ -656,13 +656,17 @@ _.compact([0, 1, false, 2, '', 3]);
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p id="flatten">
|
<p id="flatten">
|
||||||
<b class="header">flatten</b><code>_.flatten(array)</code>
|
<b class="header">flatten</b><code>_.flatten(array, [shallow])</code>
|
||||||
<br />
|
<br />
|
||||||
Flattens a nested <b>array</b> (the nesting can be to any depth).
|
Flattens a nested <b>array</b> (the nesting can be to any depth). If you
|
||||||
|
pass <b>shallow</b>, the array will only be flattened a single level.
|
||||||
</p>
|
</p>
|
||||||
<pre>
|
<pre>
|
||||||
_.flatten([1, [2], [3, [[[4]]]]]);
|
_.flatten([1, [2], [3, [[4]]]]);
|
||||||
=> [1, 2, 3, 4];
|
=> [1, 2, 3, 4];
|
||||||
|
|
||||||
|
_.flatten([1, [2], [3, [[4]]]], true);
|
||||||
|
=> [1, 2, 3, [[4]]];
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p id="without">
|
<p id="without">
|
||||||
|
|||||||
Reference in New Issue
Block a user