Code Concision - String Capitalization
Live example

String.capitalize = function(str, everyWord) {
    return _.map(_.words(str), function(val, key) {
        return key === 0 || everyWord ? _.capitalize(val) : val;
    }).join(" ");
};


Write to String not String.prototype. Extending native prototypes is not friendly.

Use underscore and underscore.string.

Basically don't re-invent the wheel ;)