Answers for "sort alphabetic js"

16

alphabetical order array javascript

arr.sort(function(a, b) {
    return a === b ? 0 : a < b ? -1 : 1;
  });
Posted by: Guest on August-11-2020
9

array sort by alphabetical javascript

users.sort((a, b) => a.firstname.localeCompare(b.firstname))
Posted by: Guest on August-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language