Change case of string, replace hyphens with spaces and capitalize first letter
Some things:


That pretty variable is pretty useless. Omit it.
temp is quite meaningless. Use a descriptive name like words or parts.
You could use the Array map method instead of that for loop. This will likely be slower, but more elegant:

function prettify(str) {
    return str.split('-').map(function capitalize(part) {
        return part.charAt(0).toUpperCase() + part.slice(1);
    }).join(' ');
}

regular expressions and the String replace method could further shorten it, and possibly improve performance:

function prettify(str) {
    return str.replace(/(-|^)([^-]?)/g, function(_, prep, letter) {
        return (prep &amp;&amp; ' ') + letter.toUpperCase();
    });
}


Decide yourself whether this is too cryptic or not.