Skip to content

Instantly share code, notes, and snippets.

@juanbrusco
Created November 5, 2018 18:19
Show Gist options
  • Save juanbrusco/8d6a923fbaa7f165d1a32331774500b0 to your computer and use it in GitHub Desktop.
Save juanbrusco/8d6a923fbaa7f165d1a32331774500b0 to your computer and use it in GitHub Desktop.
Order Array - Javscript
function order(arraylist){
return arraylist.sort(this.sortThings);
}
function sortThings(a, b) {
if (a.NOMBRE > b.NOMBRE) {
return 1;
} else if (a.NOMBRE < b.NOMBRE) {
return -1;
} else if (a.NOMBRE === b.NOMBRE) {
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment