File tree 2 files changed +19
-0
lines changed
paginated_contents/javascript
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {number } n
3
+ * @return {Function } counter
4
+ */
5
+ var createCounter = function ( n ) {
6
+ let counter = n ;
7
+
8
+ return function ( ) {
9
+ return n ++ ;
10
+ } ;
11
+ } ;
12
+
13
+ /**
14
+ * const counter = createCounter(10)
15
+ * counter() // 10
16
+ * counter() // 11
17
+ * counter() // 12
18
+ */
Original file line number Diff line number Diff line change 1
1
| # | Title | Solutions | Video | Difficulty | Tag
2
2
|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|--------------------------------------|------------------------------------------|----------------------------------------------------------------------
3
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
+ | 2620 | [ Counter] ( https://leetcode.com/problems/counter/ ) | [ Java] ( https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_2620.js ) | | Easy | Javascript
4
5
| 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