noximus
3/25/2019 - 5:18 PM

Copy and sort Items

function copyAndSortNumbers(numbers) {
  return numbers.concat().sort();
}

/* Do not modify code below this line */

const original = [1, 7, 3, 5];
const sortedCopy = copyAndSortNumbers(original);

console.log(original, '<-- should be [1, 7, 3, 5]');
console.log(sortedCopy, '<-- should be [1, 3, 5, 7]');