Skip to content

Instantly share code, notes, and snippets.

@ecaepsey
Created June 30, 2018 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecaepsey/cc2f18631d2387497be215ab9907e6d3 to your computer and use it in GitHub Desktop.
Save ecaepsey/cc2f18631d2387497be215ab9907e6d3 to your computer and use it in GitHub Desktop.
sorting
m.sort(function (a, b) {
if (a === b) {
return 0;
}
if (typeof a === typeof b) {
return a < b ? -1 : 1;
}
return typeof a < typeof b ? -1 : 1;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment