Created
March 25, 2022 13:47
-
-
Save hebertcisco/3bb189f128d7b2cf6a4563f039c501b3 to your computer and use it in GitHub Desktop.
Number ordering in JavaScript not working? Solved.
This file contains 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
const seq = [11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; | |
function sortNumbers(arrayOfNumbers: number[]) { | |
return arrayOfNumbers.sort((x, y) => x - y); | |
} | |
sortNumbers(seq); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment