Created
May 16, 2013 21:48
-
-
Save zdfs/5595376 to your computer and use it in GitHub Desktop.
Sort array by odds and evens
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
function oddsAndEvens(a,b) { | |
return Math.abs(a % 2) - Math.abs(b % 2) || a - b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment