[Javascript] Sort function

Reuben D Budiardja reubendb at goshen.edu
Wed Jul 18 11:07:56 CDT 2001


Thanks.
Apparently my problem is a bit more complicated than that. 
I have two arrays with "connected" value, that I query from the database. 
Something like:

array1		array2
7001		bach
7002		charlie
7003		washington
7004		adam

Now, if I "sort by" array2, I want array 1 to be sorted correspondingly also, 
so the result is something like:

array1		array2
7004		adam
7001		bach
7002		charlie
7003		washington

and vice versa. Can I do that in Javascript? Thanks very much for any help.

Reuben D. Budiardja


On Wednesday 18 July 2001 10:50 am, you wrote:
> Reuben D Budiardja wrote:
> > is there somekind of sort function to sort the element of an array,
>
> Not surprisingly, it's called "sort()" :-)
>
> For more detail, see
>
>   http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm
>
> HTH!



More information about the Javascript mailing list