var sortNumAsc = function(a,b){
	return a - b; //升序
}
document.write(myarray.sort(sortNumAsc));

var sortNumDesc = function(a,b){
	return b - a; //降序
}
document.write(myarray.sort(sortNumDesc));
Go to top