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

167
Views
Devuelve el objeto del mapa de matriz dentro de un bucle for JS

Estoy tratando de devolver un objeto de un mapa de matriz dentro de un bucle for y empujarlo a la matriz de datos de productos, pero obtengo [[Objeto], [Objeto]]. La matriz en cuestión es 'lol'. Aquí está el código a continuación:

 for (let i = 0; i < productsUrls.length; i++) { let ficheTechnique = []; let request = await axios.get(productsUrls[i]); const $ = cheerio.load(request.data); let productUrl = productsUrls[i]; let title = $('div.col10').find('h1.-fs20.-pts.-pbxs').text(); let price = $('div.-phs').find('div span.-b.-ltr.-tal.-fs24').text(); let description = $('div.card.aim.-mtm').find('div.markup.-mhm.-pvl.-oxa.-sc').text(); let descriptionImg = $('div.card.aim.-mtm').find('div.markup.-mhm.-pvl.-oxa.-sc center img').attr('data-src'); let lol = $('.row.-pas article').map((i, el) => { let h2 = $(el).find('h2.hdr.-upp.-fs14.-m.-pam').text(); let characteristiques = $(el).find('.markup.-pam').text() || $(el).find('.-pvs.-mvxs.-phm.-lsn').text(); return { h2, characteristiques }; }).get(); console.log('ficheTechnique', lol); productsData.push({ productUrl, title, // price, // description, // descriptionImg, // ficheTechnique, lol }) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su llamada de map está devolviendo una matriz de objetos, cada uno de los cuales contiene atributos h2 y characteristiques .

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!