mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57: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>
|
||||
|
||||
<p id="flatten">
|
||||
<b class="header">flatten</b><code>_.flatten(array)</code>
|
||||
<b class="header">flatten</b><code>_.flatten(array, [shallow])</code>
|
||||
<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>
|
||||
<pre>
|
||||
_.flatten([1, [2], [3, [[[4]]]]]);
|
||||
_.flatten([1, [2], [3, [[4]]]]);
|
||||
=> [1, 2, 3, 4];
|
||||
|
||||
_.flatten([1, [2], [3, [[4]]]], true);
|
||||
=> [1, 2, 3, [[4]]];
|
||||
</pre>
|
||||
|
||||
<p id="without">
|
||||
|
||||
Reference in New Issue
Block a user