String.prototype.repeat = function(n) {
return Array(n + 1).join(this);
};
console.log("a".repeat(10));
String.prototype.downcase = function() {
return this.toLowerCase();
};
console.log("ABCDEFGH".downcase());
String.prototype.upcase = function() {
return this.toUpperCase();
};
console.log("abcdefgh".upcase());
String.prototype.find = function(str) {
return this.indexOf(str);
};
console.log("abcdefgh".find("c"));
String.prototype.has = function(str) {
return (this.indexOf(str)) > 0;
};
console.log("abcdefgh".has("c"));