var votes = [
	{ title: 'Apple', votes: 1 },
	{ title: 'Milk', votes: 2 },
	{ title: 'Carrot', votes: 3 },
	{ title: 'Banana', votes: 2 }
];

votes.sort(function (vote1, vote2) {
	console.log(vote1);
	console.log(vote2);
});

// Logs this to the console...
// {title: "Apple", votes: 1}
// {title: "Milk", votes: 2}
// {title: "Milk", votes: 2}
// {title: "Carrot", votes: 3}
// {title: "Carrot", votes: 3}
// {title: "Banana", votes: 2}