Menu
If I define two arrays identically and test for their equality I get a “false”.
That is,
[CODE]
var ara=[];
ara[0]=[1,2,3];
ara[1]=[1,2,3];
var x=0;
if (ara[0] == ara[1]) {x = -1}
alert(x);
produces an alert of 0.
So I thought perhaps == could not be used to compare arrays.
But the following
[CODE]
var ara=[];
ara[0]=[1,2,3];
ara[1]=[1,2,3];
ara[0] = ara[1];
var x=0;
if (ara[0] == ara[1]) {x = -1}
alert(x);
produces an alert of -1.
Can someone tell me why the first comparison fails?