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

321
Vistas
How to change every specific value in an array to another value? (Javascript)

How can I change every specific value within an array to another specific value? My function splits a string into an array, and if a specific index == "T" it's supposed to change that value to "U", join the values in the array, and return the result. But the value "T" isn't changing within the array as I loop through it. What am I doing wrong?

function DNAtoRNA(dna) {

let array = dna.split();
let rna = "";

for(var i = 0; i < array.length; i++) {
  if(array[i] == 'T') {
    a[i] = 'U';
  }
  }
rna = array.join();
return rna;
}

Example input = "ATFT", output = "AUFU"

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