sort an array of javascript objects