JavaScript: sort objects in array

I needed to sort an array of objects in JavaScript recently and was quite frankly amazed by 2 things: I’d never done it before in 7+ years of JavaScript It’s really rather easy! JavaScript has Array.sort that will order an array’s contents in ascending alphabetical order. So: var testArray = ['c', 'a', 'b']; testArray.sort(); //sorts [...]