Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
Acceder a los datos obtenidos fuera del alcance de la función fetch() sin recibir una promesa pendiente

¿Cómo haría para acceder a los datos obtenidos de una función fetch() sin que me devuelvan una Promise {<pending>} ?

 function GetWords() { fetch("https://random-word-api.herokuapp.com/word?number=100") .then(response => response.json()).then((word => { return word })); } async function LoadWords() { const words = await GetWords() return words } words = LoadWords() console.log(words);

console.log(words) devuelve una Promise {<pending>} en lugar de los datos reales que se espera que sean una matriz de palabras

Ejemplo de salida esperada:

['regelated', 'pneumatophores', 'uppers', 'hexachlorethane', 'veloutes', 'hove', 'locomotives', 'vitalist', 'reascending', 'claustrophobias']

¿Qué puedo cambiar para tener tal salida?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!