Shortest possible code with ES6!
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
String.prototype.localeCompare() basic support is universal!
Shortest possible code with ES6!
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
String.prototype.localeCompare() basic support is universal!