# Array.sortOn() AS2 NewBie Issue

**URL:** https://forum.kirupa.com/t/array-sorton-as2-newbie-issue/316853
**Category:** flash
**Created:** [December 4, 2010, 9:18am UTC](https://forum.kirupa.com/t/array-sorton-as2-newbie-issue/316853 "2010-12-04T09:18:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![XiaoHei](https://avatars.discourse-cdn.com/v4/letter/x/5f8ce5/32.png) [@XiaoHei](https://forum.kirupa.com/u/XiaoHei)
#### Post date: [December 4, 2010, 9:18am UTC](https://forum.kirupa.com/t/array-sorton-as2-newbie-issue/316853/1 "2010-12-04T09:18:04Z")

</div>

I have the following simple code:

var list:Array = new Array();  
list.push( {id: “1”} );  
list.push( {id: “4”} );  
list.push( {id: “12”} );  
list.push( {id: “23”} );  
list.push( {id: “9”} );  
list.sortOn(“id”, Array.NUMERIC);

for(i=0;i\<=list.length-1;i++){  
trace(list\*[“id”]);  
}

* * *

## Output: 1 12 23 4 9

I am publishing to Flash Player 10. Shouldn’t the output be 1, 4, 9, 12, 23 instead?

p.s. I have tried google search, but no clues.
