diff --git a/lodash.js b/lodash.js index ffe815dd7..bdfdc6039 100644 --- a/lodash.js +++ b/lodash.js @@ -976,9 +976,6 @@ * // => [1, 2, 3, [[4]]]; */ function flatten(array, shallow) { - if (shallow) { - return concat.apply(ArrayProto, array); - } var value, index = -1, length = array.length, @@ -987,7 +984,7 @@ while (++index < length) { value = array[index]; if (isArray(value)) { - push.apply(result, flatten(value)); + push.apply(result, shallow ? value : flatten(value)); } else { result.push(value); } diff --git a/perf/index.html b/perf/index.html index bb731ce44..52adf326c 100644 --- a/perf/index.html +++ b/perf/index.html @@ -12,11 +12,11 @@ - + - +