(input, shallow, strict, startIndex)
| 1699 | return _.filter(array, _.identity); |
| 1700 | }; |
| 1701 | var flatten = function(input, shallow, strict, startIndex) { |
| 1702 | var output = [], idx = 0; |
| 1703 | for (var i = startIndex || 0, length = input && input.length; i < length; i++) { |
| 1704 | var value = input[i]; |
| 1705 | if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { |
| 1706 | if (!shallow) value = flatten(value, shallow, strict); |
| 1707 | var j = 0, len = value.length; |
| 1708 | output.length += len; |
| 1709 | while (j < len) { |
| 1710 | output[idx++] = value[j++]; |
| 1711 | } |
| 1712 | } else if (!strict) { |
| 1713 | output[idx++] = value; |
| 1714 | } |
| 1715 | } |
| 1716 | return output; |
| 1717 | }; |
| 1718 | _.flatten = function(array, shallow) { |
| 1719 | return flatten(array, shallow, false); |
| 1720 | }; |
no test coverage detected