In the picture shown here, I have a series of Tables being displayed:
https://i.sstatic.net/YUZD1.png
The issue highlighted in red is that I want to show the Index of each JSON array as the Table number.
Below is the code snippet:
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));
};