• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

131
Views
Traté de usar la función .map pero no funcionó en mi código
async function getCategoryIds () { let response = axios.get( `${BASE_API_URL}categories?count=100` ); let catIds = response.data.map( c => c.id ); return _.samplesize( catIds, NUM_CATEGORIES ) };

Este es mi código. Traté de cambiar los datos en [] pero aún no funciona.

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El problema principal aquí es que no ha usado await en su código. agregar una espera como la siguiente debería resolver su problema:

 let response = await axios.get( `${BASE_API_URL}categories?count=100` );
about 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error