Say I have this:
for(const v of [1,2,3]){
console.log(v);
}
const v = 5;
console.log(v);
does that create a unique local scope for v just like let
would? The above runs fine.
This fails, as we might expected given the above:
for(const v of [1,2,3]){
console.log(v);
}
console.log(v); // v is not defined, but if we used var instead of const, it would be defined