Skip to content

Commit 79cfd65

Browse files
committed
kriszta feedback
1 parent f476157 commit 79cfd65

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

js/lesson2/tutorial.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ console.log('Apples and oranges are different: ' + notEqual);
137137
```
138138

139139
> You may also see `==` and `!=`, these are similar but have some quirks so it's generally recommended to avoid them.
140-
> You can simply use `===` and `!==` and they will
140+
> It is safer to use `===` and `!==` as they will always do what you expect
141141
> always do what you expect.
142142
143143
The `>` and `<` operators are "greater than" and "less than". You can
@@ -155,7 +155,7 @@ var lessStudents = students < pizzas;
155155
console.log('Are there fewer students than pizzas?' + lessStudents);
156156

157157
```
158-
> Play around with changing the `coaches`, `students` and `pizzas` variable numbers to familiarise yourself with it more.
158+
> Play around with changing the `coaches`, `students` and `pizzas` variable numbers to familiarise yourself with more with the operators.
159159
160160
You can also combine operators.
161161

@@ -210,9 +210,15 @@ if (totalPeople > pizzas) {
210210

211211
#### Ternaries - Additional learning
212212

213-
In the latest versions of JavaScript you may see if/else statements written slighlty differently. We believe teaching the above way first helps cement how they work, however if you're working with a code base that uses the latest JavaScript you will see it written this way.
213+
You may also see if/else statements written slighlty differently.
214214

215-
The condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:) and finally the expression to execute if the condition is falsy. For example:
215+
The condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:) and finally the expression to execute if the condition is falsy.
216+
217+
```js
218+
condition ? expression1 : expression2
219+
```
220+
221+
Using the people and pizza example we wrote above and using the Ternary Operator instead of if/else it would look like this:
216222

217223
```js
218224
totalPeople > pizzas
@@ -319,7 +325,7 @@ To retrieve an item from the array, we use **square bracket notation**
319325

320326
To get the first item `animals[0]`, the second `animals[1]` etc.
321327

322-
> Create an array that includes 5 names and then access the 3rd item in the array? (don't forget to access the third item in the array you won't be doing [3])
328+
> Create an array that includes 5 names and then access the 3rd item in the array. (don't forget to access the third item in the array you won't be doing [3])
323329
324330
### Properties - `length`
325331

0 commit comments

Comments
 (0)