Re: Associative with MultiDimensional arrays
- From: "VK" <schools_ring@xxxxxxxxx>
- Date: 12 Sep 2006 13:56:38 -0700
Aziz wrote:
I try to implement a 3 dimensional array with the first index as a string. Is
it not possible?
Definitely not, because there are not "arrays with string index", they
do not exist in the nature. There objects of type Object with
properties and objects of type Array with integer indicies.
You can create an object and store array references as its properties:
var obj = {};
obj.p1 = [1,2,3];
obj.p2 = [1,2,3];
further more each array element can hold a reference either to a map or
an array:
obj.p1[0] = [1,2,3];
obj.p2[1] = {'foo':'bar'};
and further and further up to structures of any complexity.
.
- Follow-Ups:
- Re: Associative with MultiDimensional arrays
- From: Aziz
- Re: Associative with MultiDimensional arrays
- References:
- Associative with MultiDimensional arrays
- From: Aziz
- Re: Associative with MultiDimensional arrays
- From: VK
- Re: Associative with MultiDimensional arrays
- From: Aziz
- Associative with MultiDimensional arrays
- Prev by Date: Re: Inheritance breaks when setting prototype explicitly?
- Next by Date: Re: Doing Calculations with arrays
- Previous by thread: Re: Associative with MultiDimensional arrays
- Next by thread: Re: Associative with MultiDimensional arrays
- Index(es):
Relevant Pages
|