asli ari4,178 Points
Should I think about global scope, and its effect here?
On previous videos we talked about global and function scopes. Is "while" loop a function?
Because when i use guess or var guess inside the while loop, both works. How should we consider the scope effect on the loops. Is there any effect
By ES6 , let and const do have block scope. So if you use
let instead of
var in the while loop , result would be different.
Hope it helps :) . Happy Coding Asli
i think it is the same as function because if we declare a counter outside the loop scope that matches another variable outside te loop body that how would the interpreter be able to differentiate between them ?