-
Notifications
You must be signed in to change notification settings - Fork 709
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 null-aware subscript operator ?[]
to Language Tour
#3657
Comments
I agree that I also wish the language tour would mention that |
@kwalrath I noticed we currently call the |
I was going to say that we should use the name in the spec, but it seems to studiously avoid naming Btw, |
@munificent or @leafpetersen, does subscript operator work for you, or do you have another suggestion? You can look at #3674 (an update to https://dart.dev/guides/language/language-tour#other-operators) to see how it'd be used. |
Seems like languages are fairly evenly split between "subscript" and "index":
I personally lean towards "subscript" because "index" is used for other things like numeric loop variables. So, for completeness, I'd use:
|
The page https://dart.dev/guides/language/language-tour#other-operators
lists operators
()
,[]
,.
, and?.
. It is missing?[]
. I wasted many minutes looking for it and finally found it in dart-lang/language#376 . Let's add it to the language tour to save other users' time.The text was updated successfully, but these errors were encountered: