fix(curriculum): make logical AND/OR step more concise (#49965)

* Fix typos in js logical steps.

* Consistency across both pages.
This commit is contained in:
a2937
2023-04-05 13:16:07 -04:00
committed by GitHub
parent 5ea1f4fffc
commit 3500a4c0d1
2 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ dashedName: comparisons-with-the-logical-and-operator
Sometimes you will need to test more than one thing at a time. The <dfn>logical and</dfn> operator (`&&`) returns `true` if and only if the <dfn>operands</dfn> to the left and right of it are true.
The same effect could be achieved by nesting an if statement inside another if:
The same effect could be achieved by nesting an `if` statement inside another `if`.
```js
if (num > 5) {
@@ -22,7 +22,7 @@ if (num > 5) {
return "No";
```
will only return `Yes` if `num` is greater than `5` and less than `10`. The same logic can be written as:
This code will return `Yes` if `num` is greater than `5` and less than `10`. The same logic can be written with the <dfn>logical and</dfn> operator.
```js
if (num > 5 && num < 10) {

View File

@@ -13,7 +13,7 @@ The <dfn>logical or</dfn> operator (`||`) returns `true` if either of the <dfn>o
The <dfn>logical or</dfn> operator is composed of two pipe symbols: (`||`). This can typically be found between your Backspace and Enter keys.
The pattern below should look familiar from prior waypoints:
The pattern below should look familiar from prior waypoints.
```js
if (num > 10) {
@@ -25,7 +25,7 @@ if (num < 5) {
return "Yes";
```
will return `Yes` only if `num` is between `5` and `10` (5 and 10 included). The same logic can be written as:
This code will return `Yes` if `num` is between `5` and `10` (`5` and `10` included). The same logic can be written with the <dfn>logical or</dfn> operator.
```js
if (num > 10 || num < 5) {