Archive for December, 2011

Multiple tier / dimension array in javascript

It is possible to define a multiple tier javascript array  that each “member”can contain more primitive data types or array object,  below example shows 3 tier array.

  • Top tier holds array object, eg:  new Array(“002”,new Array(“BB1”,“BB2”))
  •  Second tier array holds two dimension data: a string type “002”, and another array object new Array(“BB1″,”BB2”)
  • Third tier holds multiple dimension data: “BB1″,”BB2”

<scripttype=”text/javascript”>

var array_demo = new Array( new Array(“001”,new Array(“AA1”))  ,   new Array(“002”,new Array(“BB1”,“BB2”))   ,   new Array(“003”,new Array(“CC1”,“CC2”,“CC3”))    );

</script>

Leave a comment