Skip to content

Commit 4aee7f8

Browse files
committed
Use array constructor
1 parent c4923d2 commit 4aee7f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/core/datetime/native-date-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const DEFAULT_DAY_OF_WEEK_NAMES = {
3131

3232
/** Creates an array and fills it with values. */
3333
function range<T>(length: number, valueFunction: (index: number) => T): T[] {
34-
const valuesArray = [];
34+
const valuesArray = Array(length);
3535
for (let i = 0; i < length; i++) {
3636
valuesArray[i] = valueFunction(i);
3737
}

0 commit comments

Comments
 (0)