I have some weird js-source here, that comapres a string to a twodimensional array:
secret = new Array(2);
secret[0]= new Array(2);
secret[1]= new Array(2);
secret[0][0] = 'A';
secret[0][1] = 'B';
secret[1][0] = 'C';
secret[1][1] = 'D';
pwd=prompt("Password: ","");
if (pwd==secret){
alert("Right!");
}
else{
alert("Wrong!");
}
How does js do that comparison? Is the array converted to a string or the other way round?
The array is implicitly converted to a string,
"A,B,C,D".