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.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.