JS Sort String Array
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
Motionless Macaque
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
let fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.sort()
console.log(fruits)
// [ 'Apple', 'Banana', 'Mango', 'Orange' ]