JavaScript find min/max from array of objects