SMF - Just Installed!
value: function createUniqueInitials() {
var players = this.game.state.players;
players.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
var previousPrefix = 1;
for (var i = 0; i < players.length - 1; i++) {
var prefix = 1;
for (; prefix < players[i].name.length; prefix++) {
if (players[i].name[prefix - 1].toLowerCase() !== players[i + 1].name[prefix - 1].toLowerCase()) break;
}
players[i].initials = players[i].name.slice(0, Math.max(previousPrefix, prefix));
previousPrefix = prefix;
}