We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c30c757 commit fb1a03dCopy full SHA for fb1a03d
assignments/closure.js
@@ -1,6 +1,10 @@
1
// ==== Challenge 1: Write your own closure ====
2
// Write a simple closure of your own creation. Keep it simple!
3
-
+var add = (function () {
4
+ var counter = 1;
5
+ return function () {counter += 2; return counter}
6
+})();
7
+add();
8
9
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
10
0 commit comments