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

Skip to content

Commit 5e8ad35

Browse files
authored
Update LESSONPLAN.md
1 parent 4cbdad7 commit 5e8ad35

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

Week1/LESSONPLAN.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,50 @@ Variables are simply named storage/pointer for this information.
189189

190190
#### 4. The basic data types (string, boolean, number, undefined, null)
191191

192-
TODO
192+
##### Explanation
193+
Primitive data types are typically types that are built-in or basic to a language implementation.
194+
195+
There are 5 different types of data. The compiler/computer interpretates all the variables we make as one of those datatypes.
196+
(https://javascript.info/types)
197+
198+
Boolean — true or false
199+
Null — no value
200+
Undefined — a declared variable but hasn’t been given a value
201+
Number — integers, floats, etc
202+
String — an array of characters i.e words
203+
?? Symbol — a unique value that's not equal to any other value ??
204+
##### Example
205+
* `string`, e.g. "HackYourFuture"
206+
* `number`, e.g. 5, or 10.6
207+
* `boolean`, e.g. `true` or `false`
208+
* `array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
209+
* `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".
210+
211+
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.
212+
* `symbol`
213+
214+
215+
```js
216+
let x = 5;
217+
let typeOfX = typeof x; // -> "number"
218+
```
219+
220+
221+
##### Exercise
222+
BEverybody has two minutes to find a way to declare all basic data types by making use of the typeof operator:
223+
```js
224+
let x = 5;
225+
let typeOfX = typeof x; // -> "number"
226+
```
227+
##### Essence
228+
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/
193229

194230
#### 5. The compound data types (object, array)
195231

196-
TODO
232+
##### Explanation
233+
234+
##### Example
235+
* `array`\*, e.g. `[1, 2, 3]` or `['what', 'is', 'your', 'name']`
236+
* `object`, e.g. `{name: 'John', age: 24}`, or the special object `null`
237+
##### Exercise
238+
##### Essence

0 commit comments

Comments
 (0)