From a8c956fe6ae16a22d11a48cd77a956c2ad7125d6 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 23 Jan 2012 17:03:19 -0500 Subject: [PATCH] Fixes #436 -- document the second argument to _.flatten --- index.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3c0ce397f..69a6e13be 100644 --- a/index.html +++ b/index.html @@ -656,13 +656,17 @@ _.compact([0, 1, false, 2, '', 3]);

- flatten_.flatten(array) + flatten_.flatten(array, [shallow])
- Flattens a nested array (the nesting can be to any depth). + Flattens a nested array (the nesting can be to any depth). If you + pass shallow, the array will only be flattened a single level.

-_.flatten([1, [2], [3, [[[4]]]]]);
+_.flatten([1, [2], [3, [[4]]]]);
 => [1, 2, 3, 4];
+
+_.flatten([1, [2], [3, [[4]]]], true);
+=> [1, 2, 3, [[4]]];