mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-31 18:01:36 -04:00
fix(curriculum): typo falsey instead of falsy (#60706)
This commit is contained in:
@@ -40,7 +40,7 @@ const result = false && 0;
|
||||
console.log(result); // false
|
||||
```
|
||||
|
||||
Since `false` is a falsey value, then `false` is logged to the console. The logical AND operator is useful when you want to check multiple conditions and ensure that all are true before proceeding. Here is an example:
|
||||
Since `false` is a falsy value, then `false` is logged to the console. The logical AND operator is useful when you want to check multiple conditions and ensure that all are true before proceeding. Here is an example:
|
||||
|
||||
```js
|
||||
if (2 < 3 && 3 < 4) {
|
||||
@@ -90,7 +90,7 @@ const result = null ?? 'default';
|
||||
console.log(result); // default
|
||||
```
|
||||
|
||||
Since `null` is a falsey value, the string `default` would be logged to the console. The nullish coalescing operator is incredibly useful in situations where `null` or `undefined` are the only values that should trigger a fallback or default value. Here is an example of dealing with a user's preference settings:
|
||||
Since `null` is a falsy value, the string `default` would be logged to the console. The nullish coalescing operator is incredibly useful in situations where `null` or `undefined` are the only values that should trigger a fallback or default value. Here is an example of dealing with a user's preference settings:
|
||||
|
||||
```js
|
||||
const userSettings = {
|
||||
|
||||
@@ -35,7 +35,7 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
When you click your `checkMessageButton` and the `isSpam(messageInput.value)` is falsey, you should set the `textContent` property of `result` to `"This message does not seem to contain any spam."`.
|
||||
When you click your `checkMessageButton` and the `isSpam(messageInput.value)` is falsy, you should set the `textContent` property of `result` to `"This message does not seem to contain any spam."`.
|
||||
|
||||
```js
|
||||
messageInput.value = "spam";
|
||||
|
||||
Reference in New Issue
Block a user