sort array alphabetircally by value js code example Example: array sort by alphabetical javascript users.sort((a, b) => a.firstname.localeCompare(b.firstname))