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

246
Views
EJS For loop and If statement are not getting the right value

I'm trying to do a CRUD and its already insert values but when it comes to list that values, dont get the values, for this code I'm using ejs and html

<% if(data) { %>
       <% for (var i =0; i < data.length;  i++ ) { %>
             <tr>
                 <th><%= i+1 %></th>
                 <th><%= data[i].name %></th>
             </tr>
        <% } %>
 <% } %>

**But when I put a number (0 or 1) instead of i it capture the right value **

<th><%= data[0].name %></th>
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!