Skip to content

Commit 6fb4f8e

Browse files
Mustafa UZUNljharb
Mustafa UZUN
authored andcommitted
[guide] add Optional Chaining
1 parent ca0ff97 commit 6fb4f8e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,14 @@ Other Style Guides
28522852
&& jsonData.foo.bar.baz.quux
28532853
&& jsonData.foo.bar.baz.quux.xyzzy;
28542854

2855+
// better
2856+
const foo = jsonData
2857+
?.foo
2858+
?.bar
2859+
?.baz
2860+
?.quux
2861+
?.xyzzy;
2862+
28552863
// good
28562864
$.ajax({
28572865
method: 'POST',

0 commit comments

Comments
 (0)