Skip to content

Commit ca0ff97

Browse files
Mustafa UZUNljharb
Mustafa UZUN
authored andcommitted
[guide] add Nullish Coalescing operator
1 parent 0b1f623 commit ca0ff97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2096,11 +2096,13 @@ Other Style Guides
20962096
const foo = a ? a : b;
20972097
const bar = c ? true : false;
20982098
const baz = c ? false : true;
2099+
const quux = a != null ? a : b;
20992100
21002101
// good
21012102
const foo = a || b;
21022103
const bar = !!c;
21032104
const baz = !c;
2105+
const quux = a ?? b;
21042106
```
21052107

21062108
<a name="comparison--no-mixed-operators"></a>

0 commit comments

Comments
 (0)