Javascript Array sortDec()

Description

Javascript Array sortDec()

Array.prototype.sortDec = function() {
    this.sort(function(a, b) {
        if (a < b) {
            return 1;
        } else if (a > b) {
            return -1;
        } else {// w  ww. j ava  2  s  .  co  m
            return 0;
        }
    });
}



PreviousNext

Related