This might be a rather silly question, but I am having some troubles with arrays in Javascript right now. Namely, why is this:
var data = new Array(new Array('a', 'b', 'c'));
not equal to this:
var data2 = [['a', 'b', 'c']];
If I compare both arrays and print out the result it says false
. Why is that?
alert(data2==data);
>false
and much more confusing, if I create a third data array as data2 and name it data3, why is it still returning false
when I compare both?
var data3 = [['a', 'b', 'c']];
alert(data2==data3);
>false
Am I getting something wrong here?