proposal-call-this
proposal-call-this copied to clipboard
Optional chaining support?
I'm thinking this, to align it fully with object methods.
receiver?~>fn():receiver == null ? undefined : fn.call(receiver)receiver~>fn?.():typeof fn !== "function" ? undefined : fn.call(receiver)receiver?~>fn?.():receiver == null || typeof fn !== "function" ? undefined : fn.call(receiver)
I agree that optional chaining would be a logical extension of this proposal. The next time it gets presented to the committee plenary, I might raise it as a possible extension. Since the Committee tends in my experience to be conservative and incremental with regards to syntax, it might deferred to a future proposal.