[leetcode/JS] 2619. Array Prototype Last
문제
https://leetcode.com/problems/array-prototype-last/description/
prototype object
Array
this
풀이
전체 코드
interface Array<T> {
last(): T | -1;
}
Array.prototype.last = function() {
if(this.length < 1) return -1
return this[this.length...
studio-pendant.hashnode.dev1 min read