Sorting an array of objects by a key

by Per Harald Borgen

To sort an array of objects, use the prototype method .sort() on the array, and specify how you want to sort it in the compare function provided to sort.

More by Per Harald Borgen
Popular casts in topic