var y = 0 ;
while (y < 11) {
console.log(y);
y++;
};
output this:
0
1
2
3
4
5
6
7
8
9
10
10
Why are there two 10s and how would I avoid doing that using a while loop? I understand there’s other methods of doing this, but I’m just curious on how I would write this to avoid double 10s.
Codecademy does do that. I can confirm. Do not worry about it. They aren’t perfect (you’ll see that sometimes correct code is marked incorrect because they want it done a certain way)