Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • You'll need to create a custom sort function and pass it as arr.sort(sortFunction);. which takes 2 parameters. Inside the sort function, you'll need to first compare if both parameters are both numberlike, if they are, return the appropriate integer for their comparison (with number-like strings compared as numbers) and if they are not, then set both to uppercase and compare them lexicographically. Commented Oct 11, 2018 at 17:28