Skip to content

Commit 2482ef0

Browse files
committed
complete challenge on closures and remove redundant js file llink on index page
1 parent f2018ab commit 2482ef0

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

assignments/closure.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
// ==== Challenge 1: Write your own closure ====
22
// Write a simple closure of your own creation. Keep it simple!
3+
function addition(x) {
4+
return function(y) {
5+
return x + y;
6+
};
7+
}
38

9+
var add5 = addition(5);
10+
var add10 = addition(10);
11+
12+
console.log(add5(2)); // 7
13+
console.log(add10(2)); // 12
414

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

assignments/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<script src="array-methods.js"></script>
1111
<script src="callbacks.js"></script>
1212
<script src="closure.js"></script>
13-
<script src="stretch-function-conversion.js"></script>
1413
</head>
1514

1615
<body>

0 commit comments

Comments
 (0)