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
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,9 @@ if() {
157
157
```
158
158
159
159
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.
160
+
Depending on the value of the expression specified in the `switch` clause, one of the `case` statement blocks is executed. Each statement block should end with a `break` statement to ensure that a `case` doesn't 'fall through' into the next `case`.
161
+
162
+
The `default` statement at the end is executed when none of the preceding cases hold true. The `default` statement is not strictly required, but is a best practice to always specify one.
160
163
161
164
### Example
162
165
```js
@@ -165,6 +168,40 @@ if (distance < 10) {
165
168
}
166
169
```
167
170
171
+
```js
172
+
consthyfModule='JavaScript-1';
173
+
174
+
switch (hyfModule) {
175
+
case'HTML/CSS':
176
+
console.log('In this module you will learn HTML and CSS.');
177
+
break;
178
+
case'JavaScript-1':
179
+
console.log('In this module you will learn Git and JavaScript basics.');
180
+
break;
181
+
case'JavaScript-2':
182
+
console.log('In this module you will learn about JavaScript in the browser with HTML and CSS.');
183
+
break;
184
+
case'JavaScript-3':
185
+
console.log('In this module you will learn about Async and API calls.');
186
+
break;
187
+
case'Node':
188
+
console.log('This module is about building server and CLI applications using Node.');
189
+
break;
190
+
case'Database':
191
+
console.log('In this module is about Relational and Non-Relational Data and Database Systems.');
192
+
break;
193
+
case'React':
194
+
console.log('In this module you will to build Single Page Applications using React.');
195
+
break;
196
+
case'Project':
197
+
console.log('In this final module you will do your graduation project.');
198
+
break;
199
+
default:
200
+
console.log('This module is unknown: '+ hyfModule);
0 commit comments