loading
open in
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
String.prototype.wildExclamation = function() { 
  return `${this.toString()}!#?!#?`;
};

String.prototype.boldHtml = function() { 
  return `<b>${this.toString()}</b>`;
};



var test = "Hello";
console.log(test.toUpperCase()); // Standard String method
console.log(test.wildExclamation()); // Custom String method added via prototype
console.log(test.boldHtml()); // Custom String method added via prototype


console.log(String("World").toUpperCase()); // Standard String method
console.log(String("World").wildExclamation()); // Custom String method added via prototype
console.log(String("World").boldHtml()); // Custom String method added via prototype
Native Browser JavaScript