Hi < 10 would be 9 & <=10 would be 10 and I know because the toptalLaps count starts from 0 the first loop print out 10 & 11 but the conditions are still <10 <=10 so I was wondering why the first loop is printing 10 times, & the second loop is printing 11 times?
var totalLaps = 0;
while (totalLaps < 10) {
console.log('Swim Another lap!');
totalLaps += 1;
}
**10** Swim Another lap!
var totalLaps = 0;
while (totalLaps <= 10) {
console.log('Swim Another lap!');
totalLaps += 1;
}
**11** Swim Another lap!