数组的排序

var arrs = [8,19,26,4,9,0,38,10,88,7];
    console.log(arrs.sort(CB))
function CB(v1,v2){
    if(v1>v2){
        return 1;
    }else{
        return 0;
    }
}

 

posted @ 2017-12-14 17:07  web_study  阅读(238)  评论(0编辑  收藏  举报

哈哈