mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): correct sentence about the nullish coalesing operator (#63422)
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ const result = null ?? 'default';
|
||||
console.log(result); // default
|
||||
```
|
||||
|
||||
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:
|
||||
Since `null` is a nullish 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 = {
|
||||
|
||||
Reference in New Issue
Block a user