java与javascript排序回调的不同之处

Arrays.sort(values,new Comparator<Integer>(){
public int compare(Integer value1, Integer value2) {
return value2 - value1;
}
});


var values = [ 213, 16, 2058, 54, 10, 1965, 57, 9 ];
values.sort(function(value1,value2){ return value2 - value1; });

猜你喜欢

转载自lizhuang.iteye.com/blog/2227378
今日推荐