DEV Community

Discussion on: Optional Chaining Has Arrived!

Collapse
 
laurieontech profile image
Laurie • Edited

Yes, arrays are objects, but both are valid syntaxes and worth sharing.

In terms of the function I’d invite you to look directly at the proposal github.com/tc39/proposal-optional-....
The idea is that FunctionDoesNotExist is null, undefined or not a function. Using ?.() to call it will prevent an error from being thrown.
If you’re saying that is not being declared at all will still throw an error then you’re correct and I could be more clear about that.