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
###### 15. Indicate for each of these whether it is an expression or a statement:
38
+
#### Indicate for each of these whether it is an expression or a statement:
39
39
40
40
1.`l`
41
41
2.`l = 4;`
@@ -47,7 +47,7 @@ A statement is an instruction
47
47
8.`function a() { return 4; }`
48
48
9.`let a = function () { return 4; }`
49
49
50
-
######Given the following code:
50
+
#### Given the following code:
51
51
52
52
```js
53
53
let s ="Hello".toLowerCase();
@@ -73,14 +73,14 @@ if (s2 == s1) {
73
73
List all 11 *statements* in the code above
74
74
List all 28 *expressions* in the code above (BONUS!)
75
75
76
-
#####Essence
76
+
### Essence
77
77
It's important to know the difference between expressions and statement because:
78
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
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)
83
-
#####Explanation
82
+
## 3. What are operators (comparison, arithmetic, logical, assignment)
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
86
86
* Arithmetic Operators
@@ -100,35 +100,34 @@ An operator is capable of manipulating a certain value or operand. Operators are
100
100
assigns a value to its left operand based on the value of its right operand. The simple assignment operator is equal '='
Operators are very important in a programming language, because this is how we manipulate values.
109
109
In fact, operators are the buildingblocks of all possible actions.
110
110
111
111
112
112
113
113
SECOND HALF (14.00 - 16.00)
114
114
115
-
###4. What are loops (do/while & for loop)
116
-
#####Explanation
115
+
## 4. What are loops (do/while & for loop)
116
+
### Explanation
117
117
Programming loops are about doing the same thing over and over again. Another term for that is: iteration
118
118
119
119
Wikipedia: In most computer programming languages, a while loop is a (control flow) statement that allows (a block of) code to be executed repeatedly based on a given Boolean condition.
120
120
121
-
##### Example
122
-
*images*
123
-
##### Exercise
121
+
### Example
122
+
### Exercise
124
123
Make a for loop with a do-while loop
125
-
#####Essence
124
+
### Essence
126
125
In programming you have to do a lot of (alomst) similar calculations over and over again. Using loops makes it iesier (and less boring) to code. Next to that it makes sure the the code is much more compact.
127
126
128
127
You can check: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Looping_code as well. underneath the paragraph: 'Why bother'
129
128
130
129
5. What are conditional statements (if/else & switch)
131
-
#####Explanation
130
+
### Explanation
132
131
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
132
134
133
In its simplest form the `if` statement looks like this:
@@ -153,17 +152,17 @@ if() {
153
152
154
153
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