Sort an array with ascending order - Node.js Algorithm

Node.js examples for Algorithm:Sort

Description

Sort an array with ascending order

Demo Code



number.asc = function (arr) {
    arr.sort(function (a, b) {
        return a - b;
    });/*from w w w .j av a  2s.  c  o m*/
    return arr;
};

Related Tutorials