Skip to content

Instantly share code, notes, and snippets.

@tamunoibi
Created April 16, 2018 10:46
Show Gist options
  • Select an option

  • Save tamunoibi/b2223aee180357de4c7e79fdaafb3fad to your computer and use it in GitHub Desktop.

Select an option

Save tamunoibi/b2223aee180357de4c7e79fdaafb3fad to your computer and use it in GitHub Desktop.
andela challanges
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