# Multidimensinal array sortOn() no field names

**URL:** <https://forum.kirupa.com/t/multidimensinal-array-sorton-no-field-names/201631>\
**Category:** Uncategorized\
**Created:** [September 23, 2006, 11:09am UTC](https://forum.kirupa.com/t/multidimensinal-array-sorton-no-field-names/201631 "2006-09-23T11:09:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [September 23, 2006, 11:09am UTC](https://forum.kirupa.com/t/multidimensinal-array-sorton-no-field-names/201631/1 "2006-09-23T11:09:06Z")

</div>

My multidimensional array is created this way :

```auto
cards_array = new Array()
z=0
for(k=0;k<cardsColor_array.length;k++)
{
	for(i=0;i<13;i++)
	{
		cards_array[z] = new Array()
		cards_array[z][0] = cardsColor_array[k]
		cards_array[z][1] = i
		z++
	}
}

```

so the cards\_array.toString() looks like (after is mixed): h,10,h,5,h,9,t,7,h,6,r,2,c,7…  
Now I need to sort a part of the array(is a slice of this big array not the whole) on first element, or on the second.  
All of the sorting algoritms I find, help, livedocs etc… are with named elements.

My question is what is the “name” of cards\_array\*[0] element to use in a sorting algoritm…Im to lazy to write my own:) , and the array is used in too many parts refered this way to start to change all the code to named elements…
