:: Forum >>

How to change Multi-Dimensional Arrays position???

hello everybody i have Multi Dimensional arrays, and i want to show them as a table,let's say this example:

var a=["sam","ami","koby","shi","naba","cindy"];
var b=[1981,1881,1998,2200,1997,2002];
var x=[a,b];

it's working, and it must be in arrays but, when i write the array's
and i want to change array a order by "sort()" function
i don't know how to change the other arrays so it will match to the new order of the array a.

let's say that "sam" now is a[0] and 1981 is b[0]
and after sort() "same" is a[5] i need 1981 to be b[5]

if sonecan can help i'll appiciate it,
thanks.
Amir thanks for all.
Sunday, October 14, 2007
the question is more like this:

Can i see the position change (for values and there place in the array) that the sort() method did in an array, so i can effect other array's in the Multi-dimensional arrays occrdinally?

for example this is what i want to do:


array a array b
A 2
B 1
C 3

after new order: (order by numeric for array b )


array a array b
B 1
A 2
C 3

does anyone's how to do it ?

Amir thanks for all.
Sunday, October 14, 2007

This topic is archived.


Back to support forum

Forum search