I have a lists of Tables that is being displayed as seen here in the image:
Encircled Red is the problem wherein I want to display the Index of each JSON array as my Table number.
Here's my code:
function getExternal() {
fetch('https://kyoala-api-dev.firebaseapp.com/queue-group/5e866db4-65f6-4ef0-af62-b6944ff029e5')
.then(res => res.json())
.then((res) => {
let reservationList = '';
res.forEach(function (reservation) {
reservationList += `
<tr>
<th scope="row">Table</th>
<td class="text-center">${reservation.minCapacity} - ${reservation.maxCapacity}</td>
<td class="text-center">${reservation.activeQueuesCount}</td>
</tr>`;
});
document.getElementById('lists').innerHTML = reservationList;
})
.catch(err => console.log(err));
};