![]() Preserved Topic: Multi-dimensional arrays and length. (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
![]() Couple of questions. First of all, does javascript handle multiple dimension arrays the same as java? ie. arrays of arrays. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Yup and yup. Array.length works fine, and in fact, you can *set* it in order to truncate an array. |
Nervous Wreck (II) Inmate From: Netherworld |
![]() How exactly can I create a two dimensional array in Javascript? Is it possible at all? |
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
![]() I'm not very experienced with javascript syntax, and so I don't know if you even need to declare your arrays (in PHP u can just start filling them without a declaration...) but assuming you need a declaration, you would define a 10 x 10 array like so: |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() You can also simulate this by creating objects ie: |