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
+49-49Lines changed: 49 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -39,23 +39,23 @@ Write commands to do following:
39
39
40
40
1. Write a console.log statement saying "Hello World!" for each language that you know.
41
41
42
-
2. Consider the following code:
42
+
2. Consider the following code:
43
43
```
44
44
console.log('I'm awesome');
45
45
```
46
-
⋅⋅1. Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error, Hint read the error message carefully, it also gives an indication of where the problem is.
46
+
2.1 Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error, Hint read the error message carefully, it also gives an indication of where the problem is.
47
47
48
-
3. Declare a variable `x` and initialize it with an integer.
49
-
⋅⋅1. First, _declare_ your variable `x`.
50
-
⋅⋅2. Add a console.log statement that explains that explains in words what _you think_the value of `x` is, like in this example:
48
+
3. Declare a variable `x` and initialize it with an integer.
49
+
3.1 First, _declare_ your variable `x`.
50
+
3.2 Add a console.log statement that explains that explains in words what _you think_the value of `x` is, like in this example:
51
51
```js
52
52
// TODO -> here you initialize your variable
53
53
console.log('the value of my variable x will be: whateverYouThinkItWillLog');
54
54
```
55
-
⋅⋅3. Add a console.log statement that logs the value of `x`
56
-
⋅⋅4. Now _initialize_ your variable `x` with an integer
57
-
⋅⋅5. Now add a console.log statement that explains what _you think_ the value of `x` is.
58
-
⋅⋅3.6 Add a console.log statement that logs the value of `x`.
55
+
3.3 Add a console.log statement that logs the value of `x`
56
+
3.4 Now _initialize_ your variable `x` with an integer
57
+
3.5 Now add a console.log statement that explains what _you think_ the value of `x` is.
58
+
3.6 Add a console.log statement that logs the value of `x`.
59
59
Steps to be taken:
60
60
61
61
```js
@@ -67,12 +67,12 @@ console.log('I'm awesome');
67
67
// TODO -> log value of x again
68
68
```
69
69
70
-
4. Declare a variable `y` and assign a string to it.
71
-
⋅⋅4.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is
72
-
⋅⋅4.2 Now console.log the variable `y`.
73
-
⋅⋅4.3 Now assign a new string to the variable `y`
74
-
⋅⋅4.4 Just like you did before write a console.log statement that explains in words what you think will be logged to the console.
75
-
⋅⋅4.5 Now console.log `y` again.
70
+
4. Declare a variable `y` and assign a string to it.
71
+
4.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is
72
+
4.2 Now console.log the variable `y`.
73
+
4.3 Now assign a new string to the variable `y`
74
+
4.4 Just like you did before write a console.log statement that explains in words what you think will be logged to the console.
75
+
4.5 Now console.log `y` again.
76
76
```js
77
77
// TODO -> here you declare AND assign your string
78
78
console.log('the value of my string will be: whateverYouThinkItWillLog');
@@ -82,40 +82,40 @@ console.log('I'm awesome');
82
82
// TODO -> log the actual value of the string to the console
83
83
```
84
84
85
-
5. How do you round the number 7.25, to the nearest integer?
86
-
⋅⋅5.1 Declare a variable `z` and assign the number 7.25 to it.
87
-
⋅⋅5.2 Console.log `z`.
88
-
⋅⋅5.3 Declare another variable `a` that has the value of z but rounded to the nearest integer.
89
-
⋅⋅5.4 Console.log `a`
90
-
⋅⋅5.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
91
-
⋅⋅5.6 Console.log the highest value.
92
-
93
-
6. Arrays!
94
-
⋅⋅6.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
95
-
⋅⋅6.2 Write a console.log statement that explains in words what you think the value of the array is.
96
-
⋅⋅6.3 Console.log your array.
97
-
⋅⋅6.4 Create an array that has your favorite animals inside
98
-
⋅⋅6.5 Log your array
99
-
⋅⋅6.6 Add a statement that adds Daan's favorite animal (baby pig) to the existing array
100
-
⋅⋅6.7 Log your new array!
85
+
5. How do you round the number 7.25, to the nearest integer?
86
+
5.1 Declare a variable `z` and assign the number 7.25 to it.
87
+
5.2 Console.log `z`.
88
+
5.3 Declare another variable `a` that has the value of z but rounded to the nearest integer.
89
+
5.4 Console.log `a`
90
+
5.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
91
+
5.6 Console.log the highest value.
92
+
93
+
6. Arrays!
94
+
6.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
95
+
6.2 Write a console.log statement that explains in words what you think the value of the array is.
96
+
6.3 Console.log your array.
97
+
6.4 Create an array that has your favorite animals inside
98
+
6.5 Log your array
99
+
6.6 Add a statement that adds Daan's favorite animal (baby pig) to the existing array
100
+
6.7 Log your new array!
101
101
102
102
7. More strings
103
-
⋅⋅7.1 Let's consider the following string: `let myString = "this,is,a,test"`.
104
-
⋅⋅7.2 Add the string to your file and console.log it.
105
-
⋅⋅7.3 Find a way to get the length of `myString`.
106
-
⋅⋅7.4 Console.log the length of `myString`.
107
-
108
-
8. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
109
-
⋅⋅8.1 First declare at least four variables and assign them different data types.
110
-
⋅⋅8.2 For each variable write a `console.log` statement that logs the value
103
+
7.1 Let's consider the following string: `let myString = "this,is,a,test"`.
104
+
7.2 Add the string to your file and console.log it.
105
+
7.3 Find a way to get the length of `myString`.
106
+
7.4 Console.log the length of `myString`.
107
+
108
+
8. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
109
+
8.1 First declare at least four variables and assign them different data types.
110
+
8.2 For each variable write a `console.log` statement that logs the value
111
111
```js
112
112
let foo =3;
113
113
console.log('The value of my variable foo is: '+ foo);
114
114
```
115
-
⋅⋅8.3 Now write a console.log statement wherein you first explain in words what you think the _type_ of your variables is.
116
-
⋅⋅8.4 Now use `typeof` to log the actual _type_ of your variables.
117
-
⋅⋅8.5 Now compare the types of your different variables with one another.
118
-
⋅⋅8.6 Make sure to also show a message when the variables you are comparing are not the same type.
115
+
8.3 Now write a console.log statement wherein you first explain in words what you think the _type_ of your variables is.
116
+
8.4 Now use `typeof` to log the actual _type_ of your variables.
117
+
8.5 Now compare the types of your different variables with one another.
118
+
8.6 Make sure to also show a message when the variables you are comparing are not the same type.
119
119
For example:
120
120
```js
121
121
let x = 9;
@@ -127,13 +127,13 @@ console.log('I'm awesome');
127
127
// TODO -> add a way of giving feedback if your variables don't have the same type
128
128
```
129
129
130
-
9. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
131
-
⋅⋅9.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
130
+
9. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
131
+
9.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
132
132
133
-
10. Write a program to answer the following questions:
134
-
⋅⋅10.1 Can you store multiple types in an array? Numbers and strings?
135
-
⋅⋅10.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
136
-
⋅⋅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).
133
+
10. Write a program to answer the following questions:
134
+
10.1 Can you store multiple types in an array? Numbers and strings?
135
+
10.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
136
+
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).
0 commit comments