Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
In a custom prototype method leverage root prototype methods

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!