What are the repercussions of adding functions to the String class in JavaScript? Is this a bad idea? E.g.,
// String functions
String.prototype.startsWith = function(string) {
return (this.indexOf(string) === 0);
}
String.prototype.empty = function() {
//console.log($.trim(this.valueOf()));
if($.trim(this.valueOf()) == '') {
return true;
}
else {
return false;
}
}