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

176
Views
innerhtml no imprime la matriz completa

Estoy usando innerhtmal para la salida, pero el problema es que muestra 1 valor menos en la matriz. No puedo encontrar el problema.

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

 await fetch(urlbody, bodyrequestOptions) .then((response) => response.json()) .then((payload) => { console.log(payload) payload.map(({ TRANS_NO, TRANS_DATE, DR_AMT, CR_AMT, PARTICULAR }, index) => { /* Calculatation*/ oprningbalance += CR_AMT oprningbalance -= DR_AMT document.getElementById('output2').innerHTML += `<tr> <td>${index + 1}</td> <td class="text-tiny text-break">${moment(TRANS_DATE).format('LLL')}</td> <td class="text-tiny">${TRANS_NO}</td> <td class="text-tiny">${DR_AMT.toFixed(2)}</td> <td class="text-tiny">${CR_AMT.toFixed(2)}</td> <td class="text-tiny">${oprningbalance.toFixed(2)}</td> <td class="text-tiny text-break">${PARTICULAR}</td> </tr>` total_dr += DR_AMT total_cr += CR_AMT })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto en su lugar

 document.getElementById('output2').innerHTML = payload.map(({TRANS_NO,TRANS_DATE,DR_AMT,CR_AMT,PARTICULAR}, index) => { /* Calculatation*/ oprningbalance += CR_AMT oprningbalance -= DR_AMT total_dr += DR_AMT total_cr += CR_AMT return `<tr> <td>${index + 1}</td> <td class="text-tiny text-break">${moment(TRANS_DATE).format('LLL')}</td> <td class="text-tiny">${TRANS_NO}</td> <td class="text-tiny">${DR_AMT.toFixed(2)}</td> <td class="text-tiny">${CR_AMT.toFixed(2)}</td> <td class="text-tiny">${oprningbalance.toFixed(2)}</td> <td class="text-tiny text-break">${PARTICULAR}</td> </tr>` }).join("")
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!