Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

Commit 683e47e

Browse files
author
Kevin Hermawan
committed
refactor: improves performance getFirst and getLast
1 parent ec3af19 commit 683e47e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/getFirst.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function getFirst<T>(array: T[]) {
2-
return array.at(0);
2+
return array[0];
33
}

Diff for: src/getLast.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function getLast<T>(array: T[]) {
2-
return array.at(array.length - 1);
2+
return array[array.length - 1];
33
}

0 commit comments

Comments
 (0)