Skip to content

Commit

Permalink
Update 2619 array prototype last
Browse files Browse the repository at this point in the history
  • Loading branch information
escwxyz committed Apr 27, 2023
1 parent 945a3f0 commit 46b2913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typescript/src/2619-array-prototype-last.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare global {
}
}
Array.prototype.last = function () {
return this.length > 0 ? this.pop() : -1
return this[this.length - 1] || -1
}

if (import.meta.vitest) {
Expand Down

0 comments on commit 46b2913

Please sign in to comment.