function com(value1, value2) {
if (value1 < value2) {
return -1;
} else if (value1 > value2) {
return 1;
} else {
return 0;
}
}
var box = [1, 2, 3, 4, 5, 15, 22, 55];
alert(typeof(box));
alert(box.sort(com));
alert(box.reverse());
alert(typeof(box));