Solution for "order array string javascript"

users.sort((a, b) => a.firstname.localeCompare(b.firstname))

javascript order by string array

var names = ["Peter", "Emma", "Jack", "Mia"]; var sorted = names.sort(); // ["Emma", "Jack", "Mia", "Peter"]

string sort javascript

Similar codes for "order array string javascript"


Latest 'Javascript' questions

Added before "order array string javascript"