1
J'ai un peu bizarre js source ici, qui comapres une chaîne à un tableau deux dimensions:La comparaison d'une chaîne à un tableau à deux dimensions
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!");
}
Comment ne fait js cette comparaison? Le tableau est-il converti en une chaîne ou inversement?