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

131
Vistas
How do you easily go to the next item inside an Array?

I'm creating a random word generator which will contain a lot of words. I'm using the following code:

function gentext() {
var word=['example', 'word', '', '' , '', '', '', '', '', '', '', '', '',];
var para=document.querySelector('p');
para.innerHTML=word[Math.floor(Math.random()*word.length)];
}

In between the apostrophes I need to fill in all the other words to come. Is there an easy way to go immediately between the apostrophes instead of using the right arrow key several times inside Visual Studio Code?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can write a small code for it, for example write all your words in a single string : `

let str = "word example cat dog eats monkey node angular javascript";

const word = str.split(" ");
console.log(word)

And you have your array as word.

about 4 years ago · Juan Pablo Isaza Denunciar
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