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

97
Views
cómo obtener la respuesta de retorno de función de {"_U": 0, "_V": 0, "_W": nulo, "_X": nulo}

Estoy tratando de llamar a una función en bucle y hacer una solicitud https, la respuesta vuelve a la función y devuelve :

{"_U": 0, "_V": 0, "_W": null, "_X": null}

Quiero devolver el valor exacto a esa tecla donde se llama a la función en el bucle.

Aquí está mi código :

 res.forEach(async (elem, index) => { await arr.push({ id: index, name: '', color: '#2F14A8', chain: elem.chain, address: elem.walletAddress, balance: getWalletBalance(elem.walletAddress), //<---- **function call** img: images[index % images.length], }); });

Aquí está la función :

 const getWalletBalance =async address => { let tokensArr=[] // some arry const res = await dispatch(getBalanc(address, tokensArr)); return res; }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

¿Cuál es la respuesta de res en la función getWallertBalance ? ¡Creo que si pones esperar antes getWalletBalance(elem.walletAddress) en forEach se resuelve el problema!

about 4 years ago · Juan Pablo Isaza Report

0

Esas llamadas individuales a getWalletBalance no parecen depender unas de otras. La mejor manera de hacer esto es producir una colección de promesas con map , y resolverlas al mismo tiempo...

 const getWalletBalance = async address => { const res = await dispatch(getBalanc(address, tokensArr)); const promises = res.map(element => getWalletBalance(elem.walletAddress)); const balances = await Promise.all(promises); return res.map((element, index) => { return { id: index, name: '', color: '#2F14A8', chain: element.chain, address: element.walletAddress, balance: balances[i], img: images[index % images.length], }; }) }
about 4 years ago · Juan Pablo Isaza Report
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!