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

Add support for safe navigation operator (elvis operator) #297

Open
navrocky opened this issue Feb 11, 2025 · 0 comments
Open

Add support for safe navigation operator (elvis operator) #297

navrocky opened this issue Feb 11, 2025 · 0 comments

Comments

@navrocky
Copy link
Contributor

I'll try to explain my thoughts with the help of examples.

The variable var will be null if there is no obj key:

## set var = obj?

The variable var will be null if there is no obj key or obj exists but no obj.key exists:

## set var = obj?.key?

The variable var will be null if there is no obj key or throws if there is no obj.key exists:

## set var = obj?.key
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