fix(curriculum): add result of comparison expression evaluation to the inline comment (#45224)

* Add result of comparison expression evaluation in the inline comment #45183

* Apply suggestions from code review

thanks!

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
This commit is contained in:
HenMoshe
2022-02-23 19:58:42 +02:00
committed by GitHub
parent 2586503f9c
commit ea416b6dc2
8 changed files with 32 additions and 48 deletions

View File

@ -25,14 +25,12 @@ function equalityTest(myVal) {
If `myVal` is equal to `10`, the equality operator returns `true`, so the code in the curly braces will execute, and the function will return `Equal`. Otherwise, the function will return `Not Equal`. In order for JavaScript to compare two different <dfn>data types</dfn> (for example, `numbers` and `strings`), it must convert one type to another. This is known as Type Coercion. Once it does, however, it can compare terms as follows: If `myVal` is equal to `10`, the equality operator returns `true`, so the code in the curly braces will execute, and the function will return `Equal`. Otherwise, the function will return `Not Equal`. In order for JavaScript to compare two different <dfn>data types</dfn> (for example, `numbers` and `strings`), it must convert one type to another. This is known as Type Coercion. Once it does, however, it can compare terms as follows:
```js ```js
1 == 1 1 == 1 // true
1 == 2 1 == 2 // false
1 == '1' 1 == '1' // true
"3" == 3 "3" == 3 // true
``` ```
In order, these expressions would evaluate to `true`, `false`, `true`, and `true`.
# --instructions-- # --instructions--
Add the equality operator to the indicated line so that the function will return the string `Equal` when `val` is equivalent to `12`. Add the equality operator to the indicated line so that the function will return the string `Equal` when `val` is equivalent to `12`.

View File

@ -16,14 +16,12 @@ Like the equality operator, the greater than operator will convert data types of
**Examples** **Examples**
```js ```js
5 > 3 5 > 3 // true
7 > '3' 7 > '3' // true
2 > 3 2 > 3 // false
'1' > 9 '1' > 9 // false
``` ```
In order, these expressions would evaluate to `true`, `true`, `false`, and `false`.
# --instructions-- # --instructions--
Add the greater than operator to the indicated lines so that the return statements make sense. Add the greater than operator to the indicated lines so that the return statements make sense.

View File

@ -16,14 +16,12 @@ Like the equality operator, the greater than or equal to operator will convert d
**Examples** **Examples**
```js ```js
6 >= 6 6 >= 6 // true
7 >= '3' 7 >= '3' // true
2 >= 3 2 >= 3 // false
'7' >= 9 '7' >= 9 // false
``` ```
In order, these expressions would evaluate to `true`, `true`, `false`, and `false`.
# --instructions-- # --instructions--
Add the greater than or equal to operator to the indicated lines so that the return statements make sense. Add the greater than or equal to operator to the indicated lines so that the return statements make sense.

View File

@ -14,15 +14,13 @@ The inequality operator (`!=`) is the opposite of the equality operator. It mean
**Examples** **Examples**
```js ```js
1 != 2 1 != 2 // true
1 != "1" 1 != "1" // false
1 != '1' 1 != '1' // false
1 != true 1 != true // false
0 != false 0 != false // false
``` ```
In order, these expressions would evaluate to `true`, `false`, `false`, `false`, and `false`.
# --instructions-- # --instructions--
Add the inequality operator `!=` in the `if` statement so that the function will return the string `Not Equal` when `val` is not equivalent to `99`. Add the inequality operator `!=` in the `if` statement so that the function will return the string `Not Equal` when `val` is not equivalent to `99`.

View File

@ -14,15 +14,13 @@ The less than operator (`<`) compares the values of two numbers. If the number t
**Examples** **Examples**
```js ```js
2 < 5 2 < 5 // true
'3' < 7 '3' < 7 // true
5 < 5 5 < 5 // false
3 < 2 3 < 2 // false
'8' < 4 '8' < 4 // false
``` ```
In order, these expressions would evaluate to `true`, `true`, `false`, `false`, and `false`.
# --instructions-- # --instructions--
Add the less than operator to the indicated lines so that the return statements make sense. Add the less than operator to the indicated lines so that the return statements make sense.

View File

@ -14,15 +14,13 @@ The less than or equal to operator (`<=`) compares the values of two numbers. If
**Examples** **Examples**
```js ```js
4 <= 5 4 <= 5 // true
'7' <= 7 '7' <= 7 // true
5 <= 5 5 <= 5 // true
3 <= 2 3 <= 2 // false
'8' <= 4 '8' <= 4 // false
``` ```
In order, these expressions would evaluate to `true`, `true`, `true`, `false`, and `false`.
# --instructions-- # --instructions--
Add the less than or equal to operator to the indicated lines so that the return statements make sense. Add the less than or equal to operator to the indicated lines so that the return statements make sense.

View File

@ -16,12 +16,10 @@ If the values being compared have different types, they are considered unequal,
**Examples** **Examples**
```js ```js
3 === 3 3 === 3 // true
3 === '3' 3 === '3' // false
``` ```
These conditions would return `true` and `false` respectively.
In the second example, `3` is a `Number` type and `'3'` is a `String` type. In the second example, `3` is a `Number` type and `'3'` is a `String` type.
# --instructions-- # --instructions--

View File

@ -14,13 +14,11 @@ The strict inequality operator (`!==`) is the logical opposite of the strict equ
**Examples** **Examples**
```js ```js
3 !== 3 3 !== 3 // false
3 !== '3' 3 !== '3' // true
4 !== 3 4 !== 3 // true
``` ```
In order, these expressions would evaluate to `false`, `true`, and `true`.
# --instructions-- # --instructions--
Add the strict inequality operator to the `if` statement so the function will return the string `Not Equal` when `val` is not strictly equal to `17` Add the strict inequality operator to the `if` statement so the function will return the string `Not Equal` when `val` is not strictly equal to `17`