chaining_operator_tests
Script
v2
Fork
1
2
3
4
5
6
7
8
9
const
a
=
undefined
;
const
b
=
{
}
;
const
c
=
{
foo
:
null
}
;
const
d
=
{
foo
:
[
1
,
2
]
}
;
console
.
log
(
a
?.
foo
?.
length
>
0
)
;
console
.
log
(
b
?.
foo
?.
length
>
0
)
;
console
.
log
(
c
?.
foo
?.
length
>
0
)
;
console
.
log
(
d
?.
foo
?.
length
>
0
)
;