I am looking to create a custom prototype method that will perform a list of replace() methods on a string. I attempted:
String.prototype.testP = ()=>{this.replace('t','b').replace('a','c');}
//to call
"this is a test".testP();
//hoped for
"bhis is c test"
When i attempt this, i get .replace() is not a function. Is it possible to access the list of root prototype functions for String within the custom prototype method? If possible, i would prefer not to create a custom type.