var i = 100;
function gamePlay() {
while(i >= 0) {
if (i>0) {
console.log(i);}
else{console.log(**i+1**);}
i--;
}
}
When I increse i by 1 (the part of the code that is bold), I'd like to make that change occur locally. The rest of the code should use global i but the problem is that the change applies globally and the rest of the code stops working when I add 1 to i. This is the case even if I substract 1 before closing the while loop.