We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c8c049 commit 0bbd17eCopy full SHA for 0bbd17e
src/closure.js
@@ -18,6 +18,8 @@ const counterFactory = () => {
18
// `increment` should increment a counter variable in closure scope and return it.
19
// `decrement` should decrement the counter variable and return it.
20
/*
21
+
22
+// Work in progress
23
let counter = 0;
24
25
const increment () {
@@ -28,7 +30,15 @@ const counterFactory = () => {
28
30
};
29
31
myObj = {increment, decrement};
32
return myObj;
- */
33
34
+// New approach
35
+ let count = 0;
36
37
+ const myObj = {
38
+ increments: count++,
39
+ decrement: count--,
40
+ };
41
+ */
42
43
44
const limitFunctionCallCount = (cb, n) => {
0 commit comments