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
Copy file name to clipboardExpand all lines: Week1/MAKEME.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,8 @@ console.log('I'm awesome');
114
114
<br> 6.3 Console.log your array.
115
115
<br> 6.4 Create an array that has your favorite animals inside
116
116
<br> 6.5 Log your array
117
-
<br> 6.6 Add a statement that adds Daan's favorite animal (baby pig) to the existing array
117
+
<br> 6.6 Add a statement that adds Daan's favorite animal (baby pig) to the *existing array*
118
+
118
119
<br> 6.7 Log your new array!
119
120
120
121
7. More strings
@@ -150,7 +151,7 @@ if () {
150
151
9.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
151
152
152
153
10. Write a program to answer the following questions:
153
-
10.1 Can you store multiple types in an array? Numbers and strings?
154
+
10.1 Can you store multiple types in an array? Numbers and strings? Make an example that illustrates your answer.
154
155
<br> 10.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
155
156
<br> 10.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
Copy file name to clipboardExpand all lines: Week2/MAKEME.md
+40-17Lines changed: 40 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
>[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/README.md) you find the readings you have to complete before the third lecture.
4
4
5
+
## Step 0: Feedback
6
+
7
+
_Deadline Monday_
8
+
9
+
Provide feedback to step 1 and step 3 of the homework of last week to one of your fellow students. You will be assigned to one of the assignments by the class lead of this week.
10
+
5
11
## Step 1: Recap/Read
6
12
7
13
- Have a look at [The Secret Life of JavaScript Primitives](https://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/)
@@ -19,12 +25,23 @@
19
25
<br>8. Collections
20
26
<br>11. When Things Go Wrong
21
27
28
+
## Step 3: Rover the Robot
29
+
30
+
Go and try out this cool game: http://hyf-robot.herokuapp.com/index.html, there are different levels, see how far you can get!
31
+
32
+
22
33
## Step 3: JavaScript
34
+
35
+
_Deadline Thursday_
36
+
23
37
> For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference
24
38
39
+
*IMPORTANT NOTE*
40
+
In each assignment write at least two `console.log` statements to verify if your code works correctly. In other words proof that you code works as expected. If you need inspiration look at the steps defined in the assignments from last week.
41
+
25
42
1. Create a function that takes 3 arguments and returns the sum of the three arguments.
26
43
27
-
2. Create a function named `colorCar` that receives a color, and prints out, "a red car" for example. (Hint: put it in your file and run it like before.)
44
+
2. Create a function named `colorCar` that receives a color, and prints out, "a red car" for example.
28
45
29
46
3. Create an object and a function that takes the object as a parameter and prints out all of its names and values.
30
47
@@ -53,18 +70,22 @@ if (3 == 3) {
53
70
54
71
12. Create an empty object
55
72
56
-
13. 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:
73
+
13. Create an object that contains the teachers that you have had so far for the different modules.
74
+
75
+
14. Add a property to the object you just created that contains the languages that they have taught you.
76
+
77
+
<!-- 13. 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:
57
78
58
79
```js
59
-
var obj1 = {
80
+
let obj1 = {
60
81
a: 1,
61
82
b: 'this is the letter b',
62
83
c: { foo: 'what is a foo anyway',
63
84
bar: [1,2,3,4]
64
85
}
65
86
}
66
87
67
-
var obj2 = {
88
+
let obj2 = {
68
89
a: '1',
69
90
b: 'this is the letter b',
70
91
c: { foo: 'what is a foo anyway',
@@ -76,8 +97,8 @@ if (3 == 3) {
76
97
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!
77
98
78
99
Note: give this exercise your best shot but don’t spend more than, say, one hour on it.
79
-
80
-
14. 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.
100
+
-->
101
+
15. 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.
81
102
82
103
```js
83
104
functionfoo(func) {
@@ -92,12 +113,12 @@ if (3 == 3) {
92
113
```
93
114
94
115
95
-
15. Write some code to test two arrays for equality using `==` and `===`. Test the following:
116
+
16. Write some code to test two arrays for equality using `==` and `===`. Test the following:
96
117
97
118
```js
98
-
var x = [1,2,3];
99
-
var y = [1,2,3];
100
-
var z = y;
119
+
let x = [1,2,3];
120
+
let y = [1,2,3];
121
+
let z = y;
101
122
```
102
123
103
124
What do you think will happen with `x == y`, `x === y` and `z == y` and `z == x`? Prove it!
@@ -110,20 +131,20 @@ Check out this [Fiddle](http://jsfiddle.net/jimschubert/85M4z/). You need to ope
110
131
More insights from this [Stack Overflow question](http://stackoverflow.com/questions/22395357/how-to-compare-two-arrays-are-equal-using-javascript).
111
132
112
133
113
-
16. Take a look at the following code:
134
+
17. Take a look at the following code:
114
135
115
136
```js
116
-
var o1 = { foo:'bar' };
117
-
var o2 = { foo:'bar' };
118
-
var o3 = o2;
137
+
let o1 = { foo:'bar' };
138
+
let o2 = { foo:'bar' };
139
+
let o3 = o2;
119
140
120
141
```
121
142
122
-
Show that changing `o2` changes `o3` (or not) and changing ~~`o2` changes `o3`~~ `o1` changes `o3`(or not).
143
+
Show that changing `o2` changes `o3` (or not) and changing ~~`o2` changes `o3`~~`o1` changes `o3`(or not).
123
144
124
-
Does the order that you assign (`o3 = o2` or `o2 = o3`) matter? {Jim Cramer: ???}
145
+
Does the order that you assign (`o3 = o2` or `o2 = o3`) matter? {Jim Cramer: ???}
125
146
126
-
17. What does the following code return? (And why?)
147
+
18. What does the following code return? (And why?)
0 commit comments