Created
March 29, 2021 08:44
-
-
Save redpop/b655d535cd16d8dce02f9758282c6fbf to your computer and use it in GitHub Desktop.
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 variables = Object.keys(window); | |
let sortedVariables = variables.sort((a, b) => { | |
if (a < b) return -1; | |
else if (a > b) return 1; | |
return 0; | |
}); | |
console.log(sortedVariables); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment