Pebble cricket: name shortener

I had no choice. Had to make a skanky name shortener for players in minor teams that don’t have a short name in the Cricinfo database.

var shorten = function (n) {
    var bits = n.split(' ');
    for (var i = 0; i < bits.length-1; i++)
        bits[i] = bits[i].substr(0,1);
    return bits.join('.');
};