I am facing an unusual issue with the JavaScript console in Chrome. When I type the following code into the console:
var numbers = new Array(["/php/.svn/tmp", "/php/.svn/props"]);
it returns "undefined." This leads me to believe that 'numbers' is an array with 2 elements. However, when I enter:
numbers
it displays:
[Array[2]]
Then, when I check the length using:
numbers.length
it returns 1...but why? Shouldn't it be 2? Where am I going wrong here? Is there a method that can return 2? Thank you in advance.
EDIT: Let me elaborate on my issue further. I have a function that returns this when two items are selected:
myFolders.getSelected()
["/php/.svn", "/php/upload.php"]
and this when only one item is selected:
myFolders.getSelected()
"/php/upload.php"
As you can see, the second one is not an array. Now, I am using this method to trigger a calculation of a global variable when the selected item changes:
function calculateNumberOfElements(){
var numbers = new Array(myFolders.getSelected());
selectedElementCount = numbers[0].length;
}
However, it always returns 1 or the number of characters when only one item is selected.