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

234
Vistas
In javascript, how can I change a phrase in a string?

I have a string coming in from textarea, how can I change the way a phrase is spelled in the output?

I have this code so far that works well to change each individual word but i need to check for the word before and after:

value = 'This is my text'

value = value.split(' ')
value = value.map(word => {
word === 'This' ? 
// Save 'This' and check if the next word is 'is'
// if it's true, replace 'This' and 'is' with 'It's'
: word`}).join(' ')

// Desired output: 'It's my text'

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