In this example, what is [i]
used for and what is this part of the function called? I am in a coding BootCamp and have the correct answer, but I am not sure how it actually works.
function campgroundCapacity(campgrounds)
{
let counter = 0;
for (let i = 0 ; i < campgrounds.length ; i++)
{
counter += campgrounds[i].partySize;
}
return counter;
}