# Sortting an Array by alphabet or number

**URL:** <https://forum.kirupa.com/t/sortting-an-array-by-alphabet-or-number/283002>\
**Category:** flash\
**Created:** [March 1, 2009, 7:27am UTC](https://forum.kirupa.com/t/sortting-an-array-by-alphabet-or-number/283002 "2009-03-01T07:27:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chup](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/chup/32/925_2.png) [@chup](https://forum.kirupa.com/u/chup)\
**Post date:** [March 1, 2009, 7:27am UTC](https://forum.kirupa.com/t/sortting-an-array-by-alphabet-or-number/283002/1 "2009-03-01T07:27:42Z")

</div>

Sortting an Array by alphabet or number

Hi all, say I have a list of array like this

var SDArrayIndex = new Array();  
var SDArrayName = new Array();  
var SDArrayNum = new Array();

SDArrayIndex[0] = 1;  
SDArrayName[0] = “Christopher”;  
SDArrayNum[0] = “61101231”;

SDArrayIndex[1] = 2;  
SDArrayName[1] = “Ronald”;  
SDArrayNum[1] = “61101232”;

SDArrayIndex[2] = 3;  
SDArrayName[2] = “Mary”;  
SDArrayNum[2] = “61101233”;

SDArrayIndex[3] = 4;  
SDArrayName[3] = “Lisa”;  
SDArrayNum[3] = “61101234”;

SDArrayIndex[4] = 5;  
SDArrayName[4] = “Michelle”;  
SDArrayNum[4] = “61101235”;

SDArrayIndex[5] = 6;  
SDArrayName[5] = “John”;  
SDArrayNum[5] = “61101236”;

How can I sort all the array by ascending and descending order by both alphabet (SDArrayName) and by numerical (SDArraryIndex) value? Do note that all 3 array had to reflect accordingly… any idea?
