Closed
Conversation
peterjwest
requested changes
Oct 9, 2017
|
|
||
| ### Comparing NaN | ||
| If either side of double equals `a == b` contains `NaN`, `false` will be returned. | ||
| In case of a tripple equals `a === b`, following things are considered. |
| will compare for the same **instance** of the object, much like `is` in Python | ||
| and pointer comparison in C. | ||
|
|
||
| ### Comparing NaN |
Collaborator
There was a problem hiding this comment.
I'm not quite sure about this explanation, according to my testing and research any equality with NaN, double or triple, returns false.
I would suggest an alternate explanation:
Any equality comparison with `NaN` will return `false`. This includes comparing `NaN` with itself, making it the only value in JavaScript which doesn't equal itself.
I don't think it's relevant here to talk about the type of NaN, although that should probably be added in the typeof section.
Collaborator
|
Great start, but I think currently this isn't thorough enough to be helpful. First - it could explain why |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.