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

203
Vistas
How do I get long lists of information into an array?

I am trying to build a variation of wordle in javascript+html and I need the list of all the possible wordle words in an array. I have the words in a list like this that includes all of the several thousand words. But I don't know how to make this into an array. Manually typing in thousands of them doesn't seem like a feasible solution. How can I turn a typed out list like this into an array in javascript? segment of my list of wordle words

I tried to put it into a java program that used a scanner to get all the inputs and print it out into a form with the " and [ as needed so then I could just copy the line and put it into my javascript code but with nearly thirteen thousand lines, my scanner was bugging and not reading all the words. I need a complete list. I am guessing there is some way to just do it all through javascript/html but I don't know what it is. Can someone please show me how to turn a list like this with nearly thirteen thousand values into a javascript array?

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

0

Copy the text into a textbox, then have a button that matches all lines or word characters and gives you a stringified output.

document.querySelector('button').addEventListener('click', () => {
  document.querySelector('#output').value = JSON.stringify(
    document.querySelector('#input').value
      .split('\n')
      .filter(Boolean) // just in case there are empty lines
  );
});
<textarea id="input" placeholder="foo
bar"></textarea>
<div><button>transform</button></div>
<textarea id="output"></textarea>

Then you can copy that into an array declaration statement in your code.

Another option would be to find-and-replace with regex in VSCode (or some editor) - match word characters and replace with those word characters surrounded by "s, with , at the end. Add the array delimiters manually.

https://regex101.com/r/0f5aou/1

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