Sort list of numbers - Node.js Algorithm

Node.js examples for Algorithm:Sort

Description

Sort list of numbers

Demo Code

function mySort() {
    var tags = new Array();
    tags=Array.prototype.slice.call(arguments);
    tags.sort(function(a,b){
      return a-b;
    });//from   ww w  .  j  av a  2 s.  c  o m
    return tags;
}
 
var result = mySort(50,11,16,32,24,99,57,100);
console.log(result);

Related Tutorials