We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2f85ec commit b60ebd8Copy full SHA for b60ebd8
Easy/JavaScript/counter.js
@@ -0,0 +1,11 @@
1
+var createCounter = function (x) {
2
+ let privateCounter = x - 1;
3
+ return function () {
4
+ return (privateCounter += 1);
5
+ };
6
+};
7
+
8
+const counter = createCounter(20);
9
+console.log("🚀 ~ file: counter.js:10 ~ counter:", counter());
10
11
0 commit comments