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

245
Views
Obtener dos URL Java script

¿Cómo llamar a los datos de esta matriz? Tengo que agregar dos valores de otras URL. ingrese la descripción de la imagen aquí

 <table id="sales_table"> <thead> <tr id="sales_item_title"></tr> </thead> <tbody> <tr id="sales_item"></tr> </tbody> </table> <script> async function init(){ try{ const results = await Promise.all([ fetch('https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=PLN').then((response)=> response.json()), fetch('https://min-api.cryptocompare.com/data/all/coinlist') .then((response)=> response.json()), ].map(promise=>promise.catch(error=>console.error))); console.log(results); document.querySelector('#sales_item').innerHTML = results.0.PLN } catch (error) { console.error(error); } } init(); </script>
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Devuelves dos objetos y tienes acceso al objeto por clave. En su ejemplo, PLN. Luego use: object.PLN .

 async function init() { const first = await fetch('https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=PLN') .then((response)=> response.json()); const second = await fetch('https://min-api.cryptocompare.com/data/all/coinlist') .then((response)=> response.json()); let merged = {...first, ...second}; console.log(merged); console.log('PLN:',merged.PLN) } init() .catch(e => { console.log('some problems: ' + e.message); });
about 4 years ago · Santiago Trujillo 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!