I have a very strange problem with js console in chrome, if i go in chrome console and write :
var numero = new Array(["/php/.svn/tmp", "/php/.svn/props"]);
return me "undefined" so i think numero is an array with 2 elements, but if i write:
numero
returns:
[Array[2]]
after
numero.length
and return 1 ..... why? don't return 2 ??? where am I doing wrong? can i give a method that returns 2? thanks in advance
EDIT: I will explain my problem. I have a function that return this when i selected 2 items :
myFolders.getSelected()
["/php/.svn", "/php/upload.php"]
and this when selected one items:
myFolders.getSelected()
"/php/upload.php"
as u note the second one isn't an array.
now i use this method to activate on change selected item an calculate a global variable:
function calcoloNumeroElementi(){
var numero = new Array(myFolders.getSelected());
numeroElementiSelezionati = numero[0].length;
}
but returns always 1 or the number of characters when i selected only one items.
new Array(['fdsf','dfsfd']);, leave out the[and], just donew Array('sdfdsfsd','fsdfsdfs');instead.getSelected()method is returning an array; no reason to wrap it's return value innew Array().