The question i'm working with is "Create a for loop that loops through the contents of the menuItems collection with a counter variable that starts with an initial value of 0 up to a value less than the length of the menuItems collection. Increase the counter by 1 with each iteration. Within the for loop, add an event listener to the menuItems[i] element in the collection (where i is the value of the counter), running the calcTotal() function when that item is clicked."
How do I create a loop with a counter variable that starts with an initial value of 0 up to a value less than the length of the collection I want it to pull from in javascript? And then how would I increase the counter by 1 each iteration?
I think I know how to do a loop but I have no idea how to do a counter variable.