File tree 2 files changed +16
-1
lines changed
paginated_contents/javascript
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @return {null|boolean|number|string|Array|Object }
3
+ */
4
+ Array . prototype . last = function ( ) {
5
+ if ( this . length === 0 ) {
6
+ return - 1 ;
7
+ }
8
+ return this [ this . length - 1 ] ;
9
+ } ;
10
+
11
+ /**
12
+ * const arr = [1, 2, 3];
13
+ * arr.last(); // 3
14
+ */
Original file line number Diff line number Diff line change 1
1
| # | Title | Solutions | Video | Difficulty | Tag
2
2
|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|--------------------------------------|------------------------------------------|----------------------------------------------------------------------
3
- | 2703 | [ Return Length of Arguments Passed] ( https://leetcode.com/problems/return-length-of-arguments-passed/ ) | [ Java] ( https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_2703.js ) | | Easy | Javascript
3
+ | 2703 | [ Return Length of Arguments Passed] ( https://leetcode.com/problems/return-length-of-arguments-passed/ ) | [ Java] ( https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_2703.js ) | | Easy | Javascript
4
+ | 2619 | [ Array Prototype Last] ( https://leetcode.com/problems/array-prototype-last/ ) | [ Java] ( https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_2619.js ) | | Easy | Javascript
You can’t perform that action at this time.
0 commit comments