Javascript Array zwsort()

Description

Javascript Array zwsort()


Array.prototype.zwsort=function(){
    function fun1(a,b) {
        return a.localeCompare(b);
    }/* w  w  w.ja  v a  2 s.c o  m*/
    this.sort(fun1);

}

Javascript Array zwsort()


Array.prototype.zwsort=function(){
    this.sort(fun1);//from  w  w w  . j a  va 2s . c  om
    function fun1(a,b){
        return a.localeCompare(b);
    }
};

Array.prototype.change=function(a,b){
    this.splice(a,1,b);
};



PreviousNext

Related