Remove arrayPush in favor of spreading arguments.

This commit is contained in:
John-David Dalton
2017-02-21 10:34:25 -08:00
parent 0350d4904f
commit 56b7d339a6
5 changed files with 11 additions and 30 deletions

View File

@@ -1,4 +1,3 @@
import arrayPush from './arrayPush.js'
import isFlattenable from './isFlattenable.js'
/**
@@ -26,7 +25,7 @@ function baseFlatten(array, depth, predicate, isStrict, result) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result)
} else {
arrayPush(result, value)
result.push(...value)
}
} else if (!isStrict) {
result[result.length] = value