JavaScript对数组排序

[color=orange][size=large]var arr=new Array();
for(var p in data)
{
    arr.push(p);
}
arr.sort();
/*
for(var i=0;i<arr.length;i++)
{
    dwr.util.addOptions("selFY",[{yearname:arr[i],
    value:data[arr[i]]}],"value","yearname");
}
*/
[/size][/color]

你可能感兴趣的:(JavaScript,DWR)