It would just be logical if [0] == "" because both parts are reduced to zero.

Or another question, why [] != "0" and [[]] != "0" because here both parts are reduced to zero.

http://dorey.imtqy.com/JavaScript-Equality-Table/

 console.log(Number([0])); console.log(Number("")); console.log(Number([])); console.log(Number([[]])); console.log(Number("0")); 

    1 answer 1

    both parts are reduced to zero

    Not given. The array is reduced to a string, we get two strings, and the strings are compared. And they are obviously different. But if there was a number on the right side, then in comparing the line and the number, the line would lead to a number, because of which the equality would be fulfilled:

     console.log([] == "") console.log([] == 0) console.log([] == "0") console.log([0] == "") console.log([0] == 0) console.log([0] == "0")