Skip to content

Commit 5126073

Browse files
committed
update solve problem to counter II
1 parent 2d030ab commit 5126073

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Diff for: 2665. Counter II/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const createCounter = (init) => {
2+
let tempInit = init
3+
return {
4+
increment() {
5+
return (tempInit += 1);
6+
},
7+
decrement() {
8+
return (tempInit -= 1);
9+
},
10+
reset() {
11+
tempInit = init;
12+
return tempInit;
13+
},
14+
}
15+
}

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| Create Hello World Function ||
88
| Counter ||
99
| To Be Or Not To Be ||
10-
| Counter II | |
10+
| Counter II | |
1111
| Apply Transform Over Each Element in Array ||
1212
| Filter Elements from Array ||
1313
| Array Reduce Transformation ||

0 commit comments

Comments
 (0)