Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda