Created
August 1, 2020 17:09
-
-
Save katepapineni/d3a14361fab48d40ac1cfe9aa4f93518 to your computer and use it in GitHub Desktop.
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 numbers = [3, 11, 29, 19, 7]; | |
const sort1 = (a, b) => a - b; | |
const sort2 = (a, b) => b - a; | |
// What's the output ? | |
console.log(numbers.sort(sort1)); | |
console.log(numbers.sort(sort2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment