Use the new operator with the Array constructor.

This commit is contained in:
John-David Dalton
2017-03-07 22:07:04 -08:00
parent 9260bd2f57
commit 5f2a03076d
16 changed files with 16 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ const nativeMax = Math.max
function baseRange(start, end, step, fromRight) {
let index = -1
let length = nativeMax(nativeCeil((end - start) / (step || 1)), 0)
const result = Array(length)
const result = new Array(length)
while (length--) {
result[fromRight ? length : ++index] = start