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: Week2/LESSONPLAN.md
+12-23Lines changed: 12 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,10 @@ The purpose of this class is to introduce to the student:
13
13
14
14
FIRST HALF (12.00 - 13.30)
15
15
16
-
1. Q&A about last week's concepts & homework
16
+
### 1. Q&A about last week's concepts & homework
17
+
(Add more content)
17
18
18
-
2. The difference between statements & expressions
19
+
### 2. The difference between statements & expressions
19
20
##### Explanation
20
21
An expression is a piece of code that resolves in a value (becomes a value)
21
22
@@ -69,17 +70,16 @@ if (s2 == s1) {
69
70
}
70
71
```
71
72
72
-
**18. List all 11 *statements* in the code above**
73
-
74
-
**19. List all 28 *expressions* in the code above (BONUS!)**
73
+
List all 11 *statements* in the code above
74
+
List all 28 *expressions* in the code above (BONUS!)
75
75
76
76
##### Essence
77
77
It's important to know the difference between expressions and statement because:
78
-
1. It will give you an overview on what the code is about (is it an instruction or is code that resolves in a value)
79
-
2. While writing code you'll not mix up the two and therefore make sure that you do not write wrong code.
78
+
1. It will give you an overview on what the code is about (is it an instruction or is code that resolves in a value)
79
+
2. While writing code you'll not mix up the two and therefore make sure that you do not write wrong code.
80
80
81
81
82
-
3. What are operators (comparison, arithmetic, logical, assignment)
82
+
### 3. What are operators (comparison, arithmetic, logical, assignment)
83
83
##### Explanation
84
84
An operator is capable of manipulating a certain value or operand. Operators are used to perform specific mathematical and logical computations on operands. In other words, we can say that an operator operates the operands. In JavaScript operators are used for compare values, perform arithmetic operations etc. There are various operators supported by JavaScript:
85
85
@@ -112,7 +112,7 @@ In fact, operators are the buildingblocks of all possible actions.
112
112
113
113
SECOND HALF (14.00 - 16.00)
114
114
115
-
4. What are loops (do/while & for loop)
115
+
### 4. What are loops (do/while & for loop)
116
116
##### Explanation
117
117
Programming loops are about doing the same thing over and over again. Another term for that is: iteration
118
118
@@ -129,11 +129,10 @@ You can check: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Buildin
129
129
130
130
5. What are conditional statements (if/else & switch)
131
131
##### Explanation
132
-
The normal order of execution of statements in a computer program is in straight-line order, from top to bottom. However, sometimes it is desirable to execute one or more statements conditionally, i.e. depending on whether some condition – determined by the state of your program – holds true.
132
+
The normal order of execution of statements in a computer program is in straight-line order, from top to bottom. However, sometimes it is desirable to execute one or more statements conditionally, i.e. depending on whether some condition – determined by the state of your program – holds true (Boolean expression).
133
133
134
134
In its simplest form the `if` statement looks like this:
135
135
136
-
137
136
```js
138
137
if () {
139
138
}
@@ -142,27 +141,16 @@ if () {
142
141
Then we have:
143
142
```js
144
143
if() {
145
-
146
144
} else {
147
-
148
145
}
149
-
150
-
151
146
```
147
+
At last we have:
152
148
```js
153
149
if() {
154
-
155
150
} elseif {
156
-
157
151
}
158
152
```
159
153
160
-
Here, `condition` is a boolean expression that resolves to either `true` or `false` (or, more precisely, any expression that is 'truthy' or 'falsy', as will be explained later).
161
-
162
-
The statements within the curly braces `{` and `}` will be executed if the condition holds true, otherwise these statements will be skipped (i.e. ignored).
163
-
164
-
165
-
166
154
The switch statement can sometimes be a useful alternative to a concatenation of if statements. This is the case when the condition is an expression that can be decomposed into a number of distinct values or cases, as shown in the example below.
0 commit comments