Closed Dectom closed 3 years ago
You are right, it is confusing to have different naming in same code block which does not refer to anything. This can be rewritten to
let customerName = customer.name?.getName?.(); console.log(customerName)
which results in undefined as expected and we keep the same example as defined object above.
@chrisdavidmills please assign and I'll rewrite it. Thanks
Sounds good @prosovskyf , assigned!
@chrisdavidmills please review
@prosovskyf looks good to me; thanks!
Request type
Details
On the Optional Chaining Page under the "Stacking the optional chaining operator" Section
At the bottom of the example it has the following two lines
Vacations isn't referenced anywhere else on the page neither is trip or getTime so this wouldn't work in the example given and the optional chaining would return a TypeError for non-existent root element?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining