Add: Nullish coalescing operator

Adds Nullish coalescing operator ?? into the JavaScript Conditionals
This commit is contained in:
Keivan authored and GitHub committed 2022-02-02 03:38:18 -05:00
1 parent e6a350a39a
commit c621a4c3f9
1 file changed
+9
+9
View File
@@ -208,6 +208,15 @@ let oppositeValue = !lateToWork;
// => false
console.log(oppositeValue);
```
#### Nullish coalescing operator ??
```javascript
null ?? 'I win'; // 'I win'
undefined ?? 'Me too'; // 'Me too'
false ?? 'I lose' // false
0 ?? 'I lose again' // 0
'' ?? 'Damn it' // ''
```