You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2024. It is now read-only.
|2.|Functions, For and While Loops,String and Array Manipulations |[Reading Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2)|[Homework Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/MAKEME.md)|
13
-
|3.|String and Array Manipulations|[Reading Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3)|[Homework Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3/MAKEME.md)|
14
-
|4.|Closures, Scope and Immediately Invoked function expression, Callbacks and Promises|[Reading Week 4](https://github.com/HackYourFuture/JavaScript/tree/master/Week4/README.md)|[Homework Week 4](https://github.com/HackYourFuture/JavaScript/tree/master/Week4/MAKEME.md)|
15
-
|5.|Async VS Sync, XHTTP Requests|[Reading Week 5](https://github.com/HackYourFuture/JavaScript/tree/master/Week5/README.md)|[Homework Week 5](https://github.com/HackYourFuture/JavaScript/tree/master/Week5/MAKEME.md)|
|2.|• Functions<br>• For and While Loops <br>• String and Array Manipulations |[Reading Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2)|[Homework Week 2](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/MAKEME.md)|
13
+
|3.|• String and Array Manipulations|[Reading Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3)|[Homework Week 3](https://github.com/HackYourFuture/JavaScript/tree/master/Week3/MAKEME.md)|
Copy file name to clipboardExpand all lines: Week2/MAKEME.md
+7-13Lines changed: 7 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
-
##Assignment week 2
1
+
##Assignment week 2
2
2
3
-
1.
4
-
Create a function that takes two objects as parameters and compares them. You will actually need to write two functions - one that compares with == and one that compares with ===. Remember that objects can have objects inside of them so you'll need to find a way to compare every element of every object (types and values). For example:
3
+
1. Create a function that takes two objects as parameters and compares them. You will actually need to write two functions - one that compares with == and one that compares with ===. Remember that objects can have objects inside of them so you'll need to find a way to compare every element of every object (types and values). For example:
5
4
6
5
```
7
6
var obj1 = {
@@ -23,8 +22,7 @@ var obj2 = {
23
22
24
23
in our example we'll say that obj1 == obj2 is true and obj1 === obj2 is false. Make sure you can see why before you write any code!
25
24
26
-
2.
27
-
We saw that we can pass functions as arguments to other functions. Your task is to write a function that takes another function as an argument and runs it.
25
+
2. We saw that we can pass functions as arguments to other functions. Your task is to write a function that takes another function as an argument and runs it.
We learned a little bit about callbacks in JS. A callback is simply a function passed to another function that gets executed (run) after a potentially long running operation has completed. There is another function called `setTimeout` that will wait a specified period of time and then execute a function. For example:
29
+
1. We learned a little bit about callbacks in JS. A callback is simply a function passed to another function that gets executed (run) after a potentially long running operation has completed. There is another function called `setTimeout` that will wait a specified period of time and then execute a function. For example:
31
30
32
31
```
33
32
function doIt() {
@@ -64,31 +63,26 @@ We learned a little bit about callbacks in JS. A callback is simply a function p
What will be the output of the following code - and more importantly - WHY?
23
+
2. What will be the output of the following code - and more importantly - WHY?
26
24
27
25
```
28
26
for (var i = 0; i < 3; i++) {
29
27
setTimeout(function() { alert(i); }, 1000 + i);
30
28
}
31
29
```
32
30
33
-
3.
34
-
Write a function that would allow you to do this:
31
+
3. Write a function that would allow you to do this:
35
32
36
33
```
37
34
var addSix = createBase(6);
38
35
addSix(10); // returns 16
39
36
addSix(21); // returns 27
40
37
```
41
38
42
-
4.
43
-
You will need to create an HTML document out of the below snippet to run the below code. A hint - the code is syntactically correct but doesn't do what you would expect. Can you see why and fix it?
39
+
4. You will need to create an HTML document out of the below snippet to run the below code. A hint - the code is syntactically correct but doesn't do what you would expect. Can you see why and fix it?
44
40
45
41
Don't cheat - but if you get stuck ... http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
46
42
@@ -95,5 +91,5 @@ writeDataToFile(data);
95
91
3. Display the data on your web page.
96
92
4. It should not matter which endpoint is loaded first, the data should *always* look the same (you can add "?delay=<num>" after the endpoint to simulate a delay).
97
93
98
-
- Create at least 1 issue (bug / feature / code improvement) on another students github repository. Do this in pairs.
99
-
- solve the issue proposed by another student in your github repo. More info [here](https://hackyourfuture.slack.com/files/michahell/F31BX1XT6/Merging_a_local_branch_into_master)
94
+
• Create at least 1 issue (bug / feature / code improvement) on another students github repository. Do this in pairs.
95
+
• solve the issue proposed by another student in your github repo. More info [here](https://hackyourfuture.slack.com/files/michahell/F31BX1XT6/Merging_a_local_branch_into_master)
0 commit comments