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

Proposal: Document Existential Operator Assignment #5446

Open
KyleMit opened this issue Apr 15, 2023 · 0 comments
Open

Proposal: Document Existential Operator Assignment #5446

KyleMit opened this issue Apr 15, 2023 · 0 comments

Comments

@KyleMit
Copy link

KyleMit commented Apr 15, 2023

In a divergence from the way optional chaining works in JS, CoffeeScript allows the existential operator on the left half of an assignment, whereas as JS does not.

You can see an example of this in the following code:

// input
el?.href = "b"

// output
if (el != null) {
  el.href = "b";
}

However, I don't see this documented anyway in the Existential Operator section in the docs

Since it's different from the EcmaScript implementation, it might be helpful to officially list in in CoffeeScripts docs.

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

No branches or pull requests

1 participant