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

341
Views
Hola, necesito obtener la respuesta más rápida, todo exitoso (lo que significa ignorar el rechazado) y tres primeros respondieron

Ya intenté obtener la respuesta más rápida, pero en la red de la barra de herramientas de Chrome veo todas las respuestas, pero no la más rápida. Además, como mencioné anteriormente, quiero obtener todas las respuestas exitosas e ignorar las rechazadas.

 const url = 'https://mate-academy.github.io/phone-catalogue-static/api/phones.json'; const detailsUrl = 'https://mate-academy.github.io/phone-catalogue-static/api/phones/'; const getPhones = () => { return fetch(url) .then(response => { if (!response.ok) { setTimeout(() => { return Promise.reject(new Error('It was an accident')); }, 5000); } return response.json(); }); }; const getFirstPhoneDetails = (arrId) => { return Promise.race(arrId.map(id => fetch(`${detailsUrl}${id}.json`))); }; getPhones() .then(phones => { const ids = phones.map(p => p.id); return getFirstPhoneDetails(ids); }) .catch(error => { console.warn(error); });
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!