Skip to content

Commit fb1a03d

Browse files
committed
Update closure.js
1 parent c30c757 commit fb1a03d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

assignments/closure.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// ==== Challenge 1: Write your own closure ====
22
// Write a simple closure of your own creation. Keep it simple!
3-
3+
var add = (function () {
4+
var counter = 1;
5+
return function () {counter += 2; return counter}
6+
})();
7+
add();
48

59
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
610

0 commit comments

Comments
 (0)