Custom sort function for array - Node.js Algorithm

Node.js examples for Algorithm:Sort

Description

Custom sort function for array

Demo Code


Array.prototype.mySort = function() {
  this.sort(function(a, b) {
    return a - b;
  });//from  w w  w.j  a v  a2  s . co  m
  return this;
};

Related Tutorials