Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional chaining support? #30

Open
dead-claudia opened this issue Oct 19, 2024 · 1 comment
Open

Optional chaining support? #30

dead-claudia opened this issue Oct 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dead-claudia
Copy link

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)
@js-choi js-choi added the enhancement New feature or request label Oct 20, 2024
@js-choi
Copy link
Collaborator

js-choi commented Oct 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants