You said:
If I do a
alert(ContArray.length);
I get two.
Or did you mean:
I get six ???
Because it was confusing to me so I made this example.
So this was the right time for my first attempt to make multi-dimensional array. This is what I found out(my reference is quit sparing with information about it)
Please xutopia or other experts, correct me if I'm wrong :
var ContArray = new Array();
ContArray[0] = new Array();
ContArray[1] = new Array();
ContArray[2] = new Array();
ContArray[3] = new Array();
ContArray[4] = new Array();
ContArray[5] = new Array();
ContArray[0] = ['Eric' , 'AAAA']
ContArray[1] = ['Jim' , 'BBBB']
ContArray[2] = ['George' , 'CCCC']
ContArray[3] = ['Pam' , 'DDDD']
ContArray[4] = ['John' , 'EEEE']
ContArray[5] = ['Wes' , 'FFFF']
var show = 'column1
\tcolumn2\n'
show = show + ContArray[0][0] + '\t' + ContArray[0][1] + '\n'
show = show + ContArray[1][0] + '\t' + ContArray[1][1] + '\n'
show = show + ContArray[2][0] + '\t' + ContArray[2][1] + '\n'
show = show + ContArray[3][0] + '\t' + ContArray[3][1] + '\n'
show = show + ContArray[4][0] + '\t' + ContArray[4][1] + '\n'
show = show + ContArray[5][0] + '\t' + ContArray[5][1] + '\n'
show = show + '\n'
show = show + 'column length = ' + ContArray.length + '\n'
show = show + '\n'
show = show + 'row length = ' + ContArray[0].length + '\n'
alert(show);
BTW:
\t is the escape sequence for "horizontal tab"
Erik
<!-- My sport:
Boomerang throwing !!
This year I will participate at the World Championships in Germany. (
!! Many Happy Returns !! -->