Bonsoir,
juste un petit soucis avec les tableaux JavaScript :
var toto = new Array();
toto[0] = "Enregistrement 0" ;
toto[1] = "Enregistrement 1";==> Là , toto.length vaut 2
==> Si on :
alert(toto[1]); on a bien :
Enregistrement 1var toto = new Array();
toto["Clé 0"] = "Enregistrement 0" ;
toto["Clé 1"] = "Enregistrement 1";==> Là , toto.length vaut 0
( !!! )
==> Si on :
alert(toto["Clé 1"]); on a bien :
Enregistrement 1 ( !!! )
Donc la recherche en tableau indexé marche bien mais comment fait-on pour trouver la longueur d'un tableau dont les clés ne sont pas des indices ????
Merci d'avance ...
Life is Too Short ...
Enjoy Your Life ...