Skip to content

Commit b132323

Browse files
committed
=== is king
1 parent fea7c93 commit b132323

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

conditional/concatenate.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ if(country === 'England' || country === 'Germany') {
2020
}
2121
```
2222

23-
**Note**: Just like operations on numbers, Condtions can be grouped using parenthesis, ex: ```if ( (name == "John" || name == "Jennifer") && country == "France")```.
23+
**Note**: Just like operations on numbers, Condtions can be grouped using parenthesis, ex: ```if ( (name === "John" || name === "Jennifer") && country === "France")```.
2424

2525
---
2626

27-
Fill up the 2 conditions so that `primaryCategory` equals `"E/J"` only if name equals `"John"` and country is `"England"`, and so that `secondaryCategory` equals `"E|J"` only if name equals `"John"` or country is `"England"`
27+
Fill up the 2 conditions so that `primaryCategory` equals `"E/J"` only if name equals `"John"` and country is `"England"`, and so that `secondaryCategory` equals `"E|J"` only if name equals `"John"` or country is `"England"`
2828

2929
```js
3030
var name = "John";
@@ -44,16 +44,16 @@ var name = "John";
4444
var country = "England";
4545
var primaryCategory, secondaryCategory;
4646

47-
if (name == "John" && country == "England") {
47+
if (name === "John" && country === "England") {
4848
primaryCategory = "E/J";
4949
}
50-
if (name == "John" || country == "England") {
50+
if (name === "John" || country === "England") {
5151
secondaryCategory = "E|J";
5252
}
5353
```
5454

5555
```js
56-
assert(primaryCategory == "E/J" && secondaryCategory == "E|J");
56+
assert(primaryCategory === "E/J" && secondaryCategory === "E|J");
5757
```
5858

5959
---

conditional/else.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ if(country === 'England') {
3030
Fill up the value of `name` to validate the `else` condition.
3131

3232
```js
33-
var name =
33+
var name =
3434

35-
if (name == "John") {
36-
37-
} else if (name == "Aaron") {
35+
if (name === "John") {
36+
37+
} else if (name === "Aaron") {
3838
// Valid this condition
3939
}
4040
```
4141

4242
```js
4343
var name = "Aaron";
4444

45-
if (name == "John") {
46-
47-
} else if (name == "Aaron") {
45+
if (name === "John") {
46+
47+
} else if (name === "Aaron") {
4848
// Valid this condition
4949
}
5050
```
5151

5252
```js
53-
assert(name == "Aaron");
53+
assert(name === "Aaron");
5454
```
5555

5656
---

conditional/if.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ if(country === 'Germany') {
2626
currency = 'funny, small and colourful';
2727
}
2828

29-
var message = 'this is ' + country + ', the weather is ' +
30-
weather + ', the food is ' + food + ' and the ' +
29+
var message = 'this is ' + country + ', the weather is ' +
30+
weather + ', the food is ' + food + ' and the ' +
3131
'currency is ' + currency;
3232
```
3333

@@ -38,23 +38,23 @@ var message = 'this is ' + country + ', the weather is ' +
3838
Fill up the value of `name` to validate the condition.
3939

4040
```js
41-
var name =
41+
var name =
42+
43+
if (name === "John") {
4244

43-
if (name == "John") {
44-
4545
}
4646
```
4747

4848
```js
4949
var name = "John";
5050

51-
if (name == "John") {
52-
51+
if (name === "John") {
52+
5353
}
5454
```
5555

5656
```js
57-
assert(name == "John");
57+
assert(name === "John");
5858
```
5959

6060
---

loops/for.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var message2 = ""
4141
for(var i = 0; i < 100; i++){
4242
message2 = message2 + i;
4343
}
44-
assert(message == message2);
44+
assert(message === message2);
4545
```
4646

4747
---

loops/while.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ while (message2.length < 100) {
5656
message2 = message2 + i2;
5757
i2 = i2 + 1;
5858
}
59-
assert(message == message2);
59+
assert(message === message2);
6060
```
6161

6262
---

numbers/advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Define a variable `c` as the modulus of the decremented value of `x` by 3.
1919
```js
2020
var x = 10;
2121

22-
var c =
22+
var c =
2323
```
2424

2525
```js
@@ -29,7 +29,7 @@ var c = (--x) % 3;
2929
```
3030

3131
```js
32-
assert(c == 0);
32+
assert(c === 0);
3333
```
3434

3535
---

numbers/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var y = a;
3636
```
3737

3838
```js
39-
assert(x == 10 && y == a);
39+
assert(x === 10 && y === a);
4040
```
4141

4242
---

numbers/operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var x = ((a + b) / c) * d;
3333
```
3434

3535
```js
36-
assert(x == (((a + b) / c) * d));
36+
assert(x === (((a + b) / c) * d));
3737
```
3838

3939
---

strings/length.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Store in the variable named `size` the length of `str`.
1717
```js
1818
var str = "Hello World";
1919

20-
var size =
20+
var size =
2121
```
2222

2323
```js
@@ -27,7 +27,7 @@ var size = str.length;
2727
```
2828

2929
```js
30-
assert(size == str.length);
30+
assert(size === str.length);
3131
```
3232

3333
---

0 commit comments

Comments
 (0)