Can someone help me create function for looping through array of objects and looping through objects values but only specific values that i need (id,firstname,email,role,created at,updated at), not all of them. And inserting them into html table
Array:
(2) [{…}, {…}]
0: {_id: "5fd5efc8dfb1d434b84ea1c6", firstName: "ivan", lastName: "ivic", email: "[email protected]", role: "user", repeatPassword: "password" …}
1: {_id: "5fd74b0562af8926f44b1cfd", firstName: "pero", lastName: "peric", email: "[email protected]", role: "user", repeatPassword: "password" …}
length: 2
Table:
<table class="table my-0">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Created At</th>
<th>Updated At</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>