Skip to content

Instantly share code, notes, and snippets.

@Quixomatic
Last active October 5, 2020 14:44
Show Gist options
  • Save Quixomatic/da789beef237cc33afe1e3c5b76dfa04 to your computer and use it in GitHub Desktop.
Save Quixomatic/da789beef237cc33afe1e3c5b76dfa04 to your computer and use it in GitHub Desktop.
JAVASCRIPT: Sort Array By Property Alphabetically
objArray.sort(function(a, b) {
var textA = a.DepartmentName.toUpperCase();
var textB = b.DepartmentName.toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment