Skip to content

Instantly share code, notes, and snippets.

@noximus
Created March 25, 2019 17:18
Show Gist options
  • Save noximus/dcc8a71d9cd508bb0c2f6dba05c797c6 to your computer and use it in GitHub Desktop.
Save noximus/dcc8a71d9cd508bb0c2f6dba05c797c6 to your computer and use it in GitHub Desktop.
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]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment