molily: Vergleich zweier gleicher Arrays gibt false zurück

Beitrag lesen

Hallo,

warum gibt in JavaScript [1] == [1] false aber 1 == 1 true aus?

Zur Ergänzung:
ECMAScript: The Abstract Equality Comparison Algorithm
Das läuft bei zwei Arrays darauf hinaus:
»Return true if x and y refer to the same object or if they refer to objects joined to each other (see 13.1.2). Otherwise, return false.«
(Joint objects habe ich noch nie gesehen. Das gibts wohl in der Praxis nicht.)

Mathias