Created
June 11, 2014 07:46
-
-
Save khamiltonuk/68d340d0e06f93b1e6db to your computer and use it in GitHub Desktop.
Sorting an array
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 characters
| var numbers = ['1','5','4','3','53','16','8']; | |
| var accending = function(first,second){ | |
| return first - second; | |
| } | |
| var decending = function(first,second){ | |
| return second - first; | |
| }; | |
| console.log(numbers.sort(decending)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment