-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
Explanation of this example is wrong:
https://github.com/denysdovhan/wtfjs#-is-equal-
The abstract equality operator converts both sides to numbers to compare them
This is just wrong. Strings are compared as strings, null compared to undefined is true, to-primitive might return a string instead on number and so on.
Here is how this expression simplifies:
+[] == +![];
First step would be to convert ![]
to false
because of precedence.
cubedhuang and tidalu
Metadata
Metadata
Assignees
Labels
No labels