From w3schools.com, Experiment by Teeratus_R
Open DevTools (F12), go to Sources tab. Set a breakpoint at the start of the loop to watch counter and total.