Skip to content

Commit 349c3f5

Browse files
Kat FriesKat Fries
authored andcommitted
all done -- updated
1 parent 1a6d27e commit 349c3f5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

assignments/closure.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// ==== Challenge 1: Write your own closure ====
22
// Write a simple closure of your own creation. Keep it simple!
3-
3+
function adder(num1) {
4+
return function (num2) {
5+
return num1 + num2;
6+
}
7+
}
8+
let add5 = adder(5);
9+
let add7 = add5(7);
10+
console.log(add7);
411

512
// ==== Challenge 2: Create a counter function ====
613
const counter = () => {

0 commit comments

Comments
 (0)