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/LESSONPLAN.md
+80-30Lines changed: 80 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ The purpose of this class is to introduce to the student:
13
13
14
14
## Core concepts
15
15
16
-
*FIRST HALF (12.00 - 13.30)*
16
+
_FIRST HALF (12.00 - 13.30)_
17
17
18
18
## 1. The 2 types of websites: static vs. dynamic
19
19
20
20
### Explanation
21
21
22
-
Static websites usually come with a fixed number of pages that have a specific layout. When the page runs on a browser, the content is literally static and doesn’t change in response to user actions. A static website is usually created with HTML and CSS
22
+
Static websites usually come with a fixed number of pages that have a specific layout. When the page runs on a browser, the content is literally static and doesn’t change in response to user actions. A static website is usually created with HTML and CSS
23
23
Compared to static websites, which are purely informational, a dynamic website is more functional. It allows users to interact with the information that is listed on the page. Of course, that requires utilizing more than just HTML code.
24
24
25
25
### Example
@@ -45,23 +45,31 @@ Discuss in class which claim belongs to which type of website:
45
45
Feature of Content Management System.
46
46
HTML, CSS, Javascript is used for developing the website.
47
47
Same content is delivered everytime the page is loaded.
48
-
48
+
49
+
<<<<<<< HEAD
50
+
49
51
### Essence
50
52
53
+
=======
54
+
55
+
##### Essence
56
+
57
+
> > > > > > > add exercises to part 2
58
+
51
59
[In the link is an article with (dis)advantages of both static and dynamic websites.](https://www.spiderwriting.co.uk/static-dynamic.php)
52
-
53
-
Static:
60
+
61
+
Static:
54
62
Advantage:
55
63
- Flexible
56
64
- Cheaper
57
65
Disadvantages:
58
66
- not updating content
59
67
- Scalability
60
-
68
+
61
69
Dynamic:
62
70
Advantage:
63
-
- Easy to pull in data on stuctured and organised way
64
-
- Content management system
71
+
- Easy to pull in data on stuctured and organised way
72
+
- Content management system
65
73
Disadvantage:
66
74
- Design is more fixed, becasue the pages are more of a template
67
75
- Costs
@@ -104,9 +112,16 @@ It doesn't exhibit any dynamic behaviour like:
104
112
1. rendering complex animations
105
113
1. sending requests over network to servers and fetching a response
106
114
1. and this is where JavaScript steps in.
107
-
115
+
<<<<<<< HEAD
116
+
108
117
## 3. What are variables (const & let) & naming conventions
109
118
119
+
=======
120
+
121
+
#### 3. What are variables (const & let) & naming conventions
122
+
123
+
> > > > > > > add exercises to part 2
124
+
110
125
### Explanation
111
126
112
127
In JavaScript, there are three ways of creating variables.
@@ -127,6 +142,7 @@ Three different stages of working with variables are:
127
142
- Variable assignment means throwing away the old value of a variable and replacing it with a new one. Initialization can be thought of as a special way of assignment.
1. the second variable should have no value assigned
174
-
188
+
189
+
1. make 1 variable contain your first name
190
+
1. the second variable should have no value assigned
191
+
175
192
1. Make 2 variables using the `const` keyword
176
-
1. the first variable should contain the city you currently stay at
177
-
1. come up with a value for the second variable yourself
193
+
1. the first variable should contain the town/city you currently stay at
194
+
1. come up with a value for the second variable yourself
178
195
179
196
### Essence
180
197
@@ -184,14 +201,16 @@ For example, your name and age are simple pieces of information, a string and a
184
201
185
202
Variables are simply named storage/pointer for this information.
186
203
187
-
*SECOND HALF (14.00 - 16.00)*
204
+
_SECOND HALF (14.00 - 16.00)_
188
205
189
206
## 4. The basic data types (string, boolean, number, undefined, null)
190
207
191
208
### Explanation
192
-
Primitive data types are typically types that are built-in or basic to a language implementation.
193
209
194
-
There are 5 different types of data. The compiler/computer interpretates all the variables we make as one of those datatypes.
210
+
> > > > > > > add exercises to part 2
211
+
> > > > > > > Primitive data types are typically types that are built-in or basic to a language implementation.
212
+
213
+
There are 5 different types of data. The compiler/computer interprets all the variables we make as one of those datatypes.
195
214
(https://javascript.info/types)
196
215
197
216
Boolean — true or false
@@ -200,40 +219,71 @@ Undefined — a declared variable but hasn’t been given a value
200
219
Number — integers, floats, etc
201
220
String — an array of characters i.e words
202
221
?? Symbol — a unique value that's not equal to any other value ??
222
+
203
223
### Example
204
-
*`string`, e.g. "HackYourFuture"
205
-
*`number`, e.g. 5, or 10.6
206
-
*`boolean`, e.g. `true` or `false`
207
-
*`array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
208
-
*`null and undefined` The values `null` and `undefined` are very similar in JavaScript, but they behave a bit differently. The difference is that `null` always has type "object", and `undefined` always has type "undefined".
209
224
210
-
Whenever you declare a variable, but you don't set a value, the variable will become `undefined`. JavaScript will never make a variable `null` unless you explicitly program it.
211
-
*`symbol`
225
+
-`string`, e.g. "HackYourFuture"
226
+
-`number`, e.g. 5, or 10.6
227
+
-`boolean`, e.g. `true` or `false`
228
+
-`array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
229
+
-`null`
230
+
-`undefined`
231
+
The values `null` and `undefined` are very similar in JavaScript, but they behave a bit differently. The difference is that `null` always has type "object", and `undefined` always has type "undefined".
212
232
233
+
Whenever you declare a variable (using `let`), but you don't set a value, the variable will become `undefined`. JavaScript will never make a variable `null` unless you explicitly program it.
234
+
235
+
-`symbol`
213
236
214
237
```js
215
238
let x =5;
216
239
let typeOfX =typeof x; // -> "number"
217
240
```
218
241
219
-
220
242
### Exercise
221
-
Everybody has two minutes to find a way to declare all basic data types by making use of the typeof operator:
243
+
244
+
Everybody has two minutes to find a way to declare all basic data types by making use of the typeof operator:
245
+
222
246
```js
223
247
let x =5;
224
248
let typeOfX =typeof x; // -> "number"
225
249
```
226
-
### Essence
227
-
In this way we can store a lot of data in a compact way, while the computer/compiler knows how to interpretate the 1's and 0's/
250
+
251
+
##### Essence
252
+
253
+
In this way we can store a lot of data in a compact way, while the computer/compiler knows how to interpret the 1's and 0's/
228
254
229
255
## 5. The compound data types (object, array)
230
256
231
257
### Explanation
232
258
259
+
- Object key / value
260
+
- Array numeric key value
261
+
- Array ordered
262
+
- Object not ordered
263
+
233
264
### Example
234
-
*`array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
235
-
*`object`, e.g. `{name: 'John', age: 24}`, or the special object `null`
265
+
266
+
-`array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
267
+
-`object`, e.g. `{name: 'John', age: 24}`, or the special object `null`
268
+
236
269
### Exercise
270
+
271
+
1. Create a list of your favorite types of food/dishes like this:
272
+
273
+
```js
274
+
['Chocolate', 'Risotto', 'Tuna melt'];
275
+
```
276
+
277
+
2. Create an object that contains the properties of your town/city like this:
278
+
279
+
```js
280
+
{
281
+
name:'Huizen',
282
+
province:'Noord-Holland',
283
+
citizens:50000
284
+
}
285
+
```
286
+
237
287
### Essence
238
288
239
289
_Special thanks to Jim Cramer, Yash Kapila, David Nudge for most of the content_
0 commit comments