Created
March 16, 2015 00:02
-
-
Save carlosalberto/e2e727cae71c6353ae95 to your computer and use it in GitHub Desktop.
Sample from MDN's Array.sort() with echojs
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
Reioukyuu:runtime calberto$ ../arr-sort2.js.exe | |
stringArray: Blue,Humpback,Beluga | |
Sorted: [ Beluga, Blue, Humpback ] | |
numberArray: 40,1,5,200 | |
Sorted without a compare function: [ 1, 200, 40, 5 ] | |
Sorted with compareNumbers: [ 1, 5, 40, 200 ] | |
numericStringArray: 80,9,700 | |
Sorted without a compare function: [ 700, 80, 9 ] | |
Sorted with compareNumbers: [ 9, 80, 700 ] | |
mixedNumericArray: 80,9,700,40,1,5,200 | |
Sorted without a compare function: [ 1, 200, 40, 5, 700, 80, 9 ] | |
Sorted with compareNumbers: [ 1, 5, 9, 40, 80, 200, 700 ] | |
Reioukyuu:runtime calberto$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment