Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31abd49

Browse files
authored
Merge pull request HackYourFuture#209 from HackYourFuture/improve-lessonplan-3
Improve week1 lessonplan 3
2 parents e8eb6c4 + 4664149 commit 31abd49

File tree

2 files changed

+54
-27
lines changed

2 files changed

+54
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

Week1/LESSONPLAN.md

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The purpose of this class is to introduce to the student:
66

77
- The 2 types of websites: static vs. dynamic
88
- The pillars of web development: HTML/CSS/JavaScript
9+
- where JavaScript can run: Browser / Node
910
- What are variables
1011
- How to name variables properly
1112
- What are the basic data types
@@ -60,7 +61,7 @@ Discuss in class which claim belongs to which type of website:
6061

6162
Dynamic:
6263
Advantage:
63-
- Easy to pull in data on structured and organised way
64+
- Easy to pull in data on stuctured and organised way
6465
- Content management system
6566
Disadvantage:
6667
- Design is more fixed, because the pages are more of a template
@@ -73,13 +74,17 @@ Discuss in class which claim belongs to which type of website:
7374
- HTML defines what the content is.
7475
- CSS defines the appearance of the page.
7576
- JavaScript defines behavior of the page.
77+
- Where can JavaScript run:
78+
- browser
79+
- Node
7680

7781
### Example
7882

7983
- An example about relationship between HTML, CSS and Javascript using a metaphor of building a city: https://blog.codeanalogies.com/2018/05/09/the-relationship-between-html-css-and-javascript-explained/
8084

8185
### Exercise
8286

87+
Let students fork and then clone the repository.
8388
Let students create a classwork directory and create an index.html along with an app.js. Script tag should be added to the end of body tag(reason for doing so is part of JS2 Week1).
8489

8590
The end result should look like:
@@ -101,9 +106,9 @@ A big disadvantage of web pages like this is that the only way that a visitor ha
101106
It doesn't exhibit any dynamic behavior like:
102107

103108
1. reacting to user actions such as mouse click events or key presses.
104-
1. rendering complex animations
105-
1. sending requests over network to servers and fetching a response
106-
1. and this is where JavaScript steps in.
109+
2. rendering complex animations
110+
3. sending requests over network to servers and fetching a response
111+
4. and this is where JavaScript steps in.
107112

108113
## 3. What are variables (const & let) & naming conventions
109114

@@ -143,8 +148,10 @@ console.log(age);
143148

144149
```javascript
145150
// Variable Initialization
151+
146152
var firstName = "Yash";
147153
let lastName = "Kapila";
154+
148155
const age = 29;
149156

150157
console.log(firstName);
@@ -171,12 +178,13 @@ console.log(lastName);
171178

172179
1. Create 2 variables using the `let` keyword
173180

174-
1. make 1 variable contain your first name
175-
1. the second variable should have no value assigned
181+
- make 1 variable contain your first name
182+
- the second variable should have no value assigned
176183

177184
1. Make 2 variables using the `const` keyword
178-
1. the first variable should contain the city you currently stay at
179-
1. come up with a value for the second variable yourself
185+
- the first variable should contain the city you currently stay at
186+
- come up with name and a value for the second variable yourself
187+
180188

181189
### Essence
182190

@@ -192,38 +200,32 @@ _SECOND HALF (14.00 - 16.00)_
192200

193201
### Explanation
194202

195-
Primitive data types are typically types that are built-in or basic to a language implementation.
196-
197-
There are 5 different types of data. The compiler/computer interprets all the variables we make as one of those data types.
198-
(https://javascript.info/types)
203+
In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods. There are 7 primitive data types: `string`, `number`, `bigint`, `boolean`, `null`, `undefined`, and `symbol`.
199204

200205
Boolean — true or false
201206
Null — no value
202207
Undefined — a declared variable but hasn’t been given a value
203208
Number — integers, floats, etc
204209
String — an array of characters i.e words
205-
?? Symbol — a unique value that's not equal to any other value ??
210+
Symbol — a unique value that's not equal to any other value (not used during HYF)
206211

207212
### Example
208213

209214
- `string`, e.g. "HackYourFuture"
210215
- `number`, e.g. 5, or 10.6
211216
- `boolean`, e.g. `true` or `false`
212-
- `array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
213-
- `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".
214-
215-
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.
217+
- `array`, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
218+
- `null` \*
219+
- `undefined` \*
220+
- `symbol` e.g. `new Symbol('example')`
216221

217-
- `symbol`
218-
219-
```js
220-
let x = 5;
221-
let typeOfX = typeof x; // -> "number"
222-
```
222+
\* 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".
223+
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.
223224

224225
### Exercise
225226

226-
Everybody has two minutes to find a way to declare all basic data types by making use of the typeof operator:
227+
228+
Everybody has four minutes to find a way to store all basic data types in a variable by making use of the typeof operator:
227229

228230
```js
229231
let x = 5;
@@ -238,13 +240,37 @@ In this way we can store a lot of data in a compact way, while the computer/comp
238240

239241
### Explanation
240242

243+
Pieces of information often form a group. For example the names of all the students in this class can be grouped together
244+
as a list. In JavaScript lists are stored in a datatype called an `Array`.
245+
246+
Another way pieces of information can form a group are multiple properties of the same thing. For example the dimensions
247+
of this room: length, width, height. These groups of information are stored in a datatype called an `Object`.
248+
241249
### Example
242250

243-
- `array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
244-
- `object`, e.g. `{name: 'John', age: 24}`, or the special object `null`
251+
- `array`\*, e.g. `[1, 2, 3]` or `['Gijs', 'Jim', 'Noer', 'Wouter']`
252+
- `object`, e.g. `{name: 'Wilgert', shoeSize: 42}`, or the special object `null`
245253

246254
### Exercise
247255

256+
1. Create a list of your favorite types of food/dishes like this:
257+
258+
```js
259+
const foods = ['Chocolate', 'Risotto', 'Tuna melt'];
260+
```
261+
262+
2. Create an object that contains the properties of your town/city like this:
263+
264+
```js
265+
const city = {
266+
name: 'Huizen',
267+
province: 'Noord-Holland',
268+
population: 50000,
269+
capital: false,
270+
};
271+
```
272+
248273
### Essence
249274

250-
_Special thanks to Jim Cramer, Yash Kapila, David Nudge for most of the content_
275+
- Object key: value
276+
- Array numeric index: value

0 commit comments

Comments
 (0)