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

Edited documentation/coffee/soaks.coffee via GitHub #1613

Closed
wants to merge 1 commit into from

Conversation

phiggins
Copy link

The docs appear to contain a small typo in the demonstration of using the existential operator in a chain of method calls.

@michaelficarra
Copy link
Collaborator

That's not a typo, it's one of the many existential operators:

  • unary ?:
    • a? tests that a is in scope and a != null
  • binary ?:
    • a ? b returns a if a is in scope and a != null; otherwise, b
  • ?. and ?[ ]: soaked property access:
    • a?.b or a?['b'] returns a.b if a is in scope and a != null; otherwise, undefined
  • ?( ): soaked function invocation:
    • a?(b, c) returns the result of calling a (with arguments b and c) if a is in scope and callable; otherwise, undefined
  • ?=: existential assignment:
    • a ?= b assigns the value of b to a if a is not in scope or if a == null

edit: examples

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

Successfully merging this pull request may close these issues.

2 participants