Skip to content

Instantly share code, notes, and snippets.

@anish000kumar
Last active November 8, 2018 13:52
Show Gist options
  • Save anish000kumar/c1fc31e549bf4f85184240ead5d31f36 to your computer and use it in GitHub Desktop.
Save anish000kumar/c1fc31e549bf4f85184240ead5d31f36 to your computer and use it in GitHub Desktop.
Sort array of numbers
numArray.sort((a, d) => a - d); // For ascending sort
numArray.sort((a, d) => d - a); // For descending sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment