Created
April 16, 2018 10:46
-
-
Save tamunoibi/b2223aee180357de4c7e79fdaafb3fad to your computer and use it in GitHub Desktop.
andela challanges
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
| let mySort = (nums) => { | |
| let sortNums = nums.sort( (a, b) => a - b ); | |
| let wholeNums = sortNums.map(num => Math.floor(num, -1)); | |
| let oddNums = wholeNums.filter(num => num % 2 == 1); | |
| let evenNums = wholeNums.filter(num => num % 2 == 0); | |
| let newNums = oddNums.concat(evenNums); | |
| return newNums; | |
| } | |
| mySort([90, 45, 66, 'bye', 100.5]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment