-
Notifications
You must be signed in to change notification settings - Fork 187
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
Unable to compare with Infinity #61
Comments
Thanks for the suggestion. It's a tempting idea, but I need a little bit of time to consider whether it's worth including. I'm guessing the typical use case for wanting to do this is something like finding a maximum or minimum value in an array, like this:
This does have the potentially unexpected behavior of returning
since it doesn't require an extra value not found in the array, and it returns Basically, I'm saying that I'm having trouble coming up with a compelling use case where comparison with I'm tempted to add it in anyways, since it's a simple change and I can't think of any downsides (other than a negligible increase in code size and calculation time), but first I'd like to see more examples of when it would be useful. |
I've decided to add this in, since it's a pretty simple change. Note that I didn't add a mechanism for comparison with Infinity to the |
Ah, thanks. Sorry, I forgot to get back here :| For what it's worth, in vanilla JS Anyway, thanks! |
Philosophy of mathematics aside, I find comparisons against
Infinity
and-Infinity
pretty useful, especially when initializing a cursor. Currently, this throws an error, but it'd be nice if it didn't:The text was updated successfully, but these errors were encountered: