Created
July 24, 2021 20:24
-
-
Save alibalbars/22bce07a44304581e897230bcccfd275 to your computer and use it in GitHub Desktop.
Sort Numbers
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 numbers = [4, 2, 5, 1, 3]; | |
numbers.sort((a, b) => a - b); | |
console.log(numbers); // [1, 2, 3, 4, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment