How is 1 == [1] in javascript? [duplicate]
I didn’t really understood from Rayon answer how valueOf and toString come into play when converting an object to a primitive value; so I dug into the ECMAScript 2015 specifications. Warning: Long answer. We want to check the expression 1 == [1]. Starting from the 12.10 Equality Operators we see that, after retrieving the expressions …