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

161
Views
Escritura mecanografiada: ¿Usando esperar al buscar pero devolviendo no Promise?

Si tengo una clase mecanografiada que tiene los siguientes datos:

 private _initialNames: any; async getData(): Promise<any> { const resp = await fetch(url); const { data } = await resp.json(); this._initialNames = data.reduce( (acc: any, curr: any) => ({ ...acc, [curr.name]: { found: curr.found, age: curr?.age, } }), {} ); return this._initialNames; }

cuando llamo a esta función, ¿por qué uso await getData() ? ya que está devolviendo una matriz, no una Promesa? Sé que tengo que usar async ya que estoy esperando una búsqueda interna, pero cuando llamo a la función real, ¿todavía la espero?

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!