demos/playground/demos/scoreboard/scoreboard.js
function sortedByScoreDesc(players) {
		return players.slice().sort(function(a, b) {
			if (b.score == a.score)
				return a.name.localeCompare(b.name);		// stabalize the sort
			return b.score - a.score;

		});
	}
function sortedByScoreDesc(players) {
		return players.slice().sort(function(a, b) {
			if (b.score == a.score)
				return a.name.localeCompare(b.name);		// stabalize the sort
			return b.score - a.score;

		});
	}
function sortedByScoreDesc ( players ) { return players . slice ( ) . sort ( function ( a , b ) { if ( b . score == a . score ) return a . name . localeCompare ( b . name ) ; // stabalize the sort return b . score - a . score ; } ) ; }
makes a sorted copy
makes a sorted copy