Skip to content

Commit ceb32cb

Browse files
committed
all done: inluding stretch
1 parent 9284d51 commit ceb32cb

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ With some basic JavaScript principles in hand, we can now expand our skills out
1616

1717
**Follow these steps for completing your project.**
1818

19-
* [ ] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
20-
* [ ] Add your team lead as a reviewer on the pull-request
21-
* [ ] Your team lead will count the project as complete by merging the branch back into master.
19+
* [x] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
20+
* [x] Add your team lead as a reviewer on the pull-request
21+
* [x] Your team lead will count the project as complete by merging the branch back into master.
2222

2323
## Task 1: Higher Order Functions and Callbacks
2424

@@ -50,4 +50,4 @@ We have learned that closures allow us to access values in scope that have alrea
5050
## Stretch Goals
5151

5252
* [x] Go back through the stretch problems that you skipped over and complete as many as you can.
53-
* [ ] Look up what an IIFE is in JavaScript and experiment with them
53+
* [x] Look up what an IIFE is in JavaScript and experiment with them

‎assignments/closure.js‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,17 @@ const counterFactory = () => {
7070
console.log(counterFactory().decrement(), counterFactory().decrement(), counterFactory().increment(), counterFactory().increment(), counterFactory().increment());
7171
// Hmm... seems to be working!
7272

73-
console.log("———");
73+
console.log("———");
74+
75+
// Some IIFE experiments:
76+
console.log((function () {
77+
return 5 * 5;
78+
})());
79+
80+
let iifeTestArray = ["Cat", "Dog", "Giant Man-Eating Lizard"];
81+
console.log(iifeTestArray.sort((function (a, b) {
82+
if (a < b) {return -1}
83+
if (b < a) {return 1}
84+
return 0;
85+
})())); // These parentheses are getting a little ridiculous!
86+
// In any case, the above causes an error... because sort expects a function (as opposed to some returned value)?

0 commit comments

Comments
 (0)