#316·wtfjs

Explanation of first example is wrong

Author: salmanarshad2000Created Sep 1, 2023Updated Jun 24, 2024

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.