-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Request: Object.at() with default return value #570
Comments
Have a look at the |
You mean the iterator's |
Oh, that's great. I missed that one completely. I couldn't find it in anywhere in the documentation. |
Let's change this request to: |
Thanks for the hint. I mentioned the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On many implementations of dictionary-like structures, we have an
at/get
method that works like this:Object.at("key",defaultValue)
i.e. if there's no key
"key"
, then this would returndefaultValue
.Could we have something similar in this library?
Here is a possible implementation:
Usage example:
The text was updated successfully, but these errors were encountered: