Bas Wenneker has a nice little article over at solutoire.com on sorting javascript arrays. The docs over at Mozilla on Array.sort demonstrate the same stuff, but Bas's article is a quick read that's worth it if you ever see yourself working with data this way.

JavaScript:
objectArray.sort(callbackFunc);

/**
 * After sorting the objectArray will be like this:
 * [
 *  {firstname: 'Will',  lastname: 'Brown',   age: 28},
 *  {firstname: 'John',  lastname: 'Doe', age: 25},
 *  {firstname: 'Marie',     lastname: 'Doe',    age: 28},
 *  {firstname: 'Sarah',     lastname: 'Doe',    age: 25},
 *  {firstname: 'James',     lastname: 'White',  age: 28},
 *  {firstname: 'George',    lastname: 'Williams',  age: 25}
 * ]
 */

drag to resize