Created
          October 20, 2016 18:40 
        
      - 
      
 - 
        
Save panicbus/7a36ace2650cd8471dabbf08c1030fe5 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
panicbus created this gist
Oct 20, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ Array.prototype.nSort = nSort; // [].prototype.nSort works too function nSort(){ return this.sort( function numSort(n1, n2){ if (n1 < n2) return -1; if (n1 > n2) return 1; return 0; } ); } var numbers = []; numbers[0] = 20; numbers[1] = 22; numbers[2] = 21; numbers[3] = 19; console.log(numbers.nSort())