We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c1b2eb commit 2e1154eCopy full SHA for 2e1154e
1 file changed
src/closure.js
@@ -31,6 +31,12 @@ const counterFactory = () => {
31
const limitFunctionCallCount = (cb, n) => {
32
// Should return a function that invokes `cb`.
33
// The returned function should only allow `cb` to be invoked `n` times.
34
+ let count = 0;
35
+
36
+if (count < n) {
37
+ cb();
38
+ count++;
39
+}
40
};
41
42
/* STRETCH PROBLEM */
@@ -52,3 +58,4 @@ module.exports = {
52
58
cacheFunction,
53
59
limitFunctionCallCount,
54
60
61
0 commit comments