*Input 1:*
y = 0
function foo()
    y = 10
end
foo()
y

*Output 1:*
0

*Input 2:*
y = 0
for i = 1:1
    y = 10 
end
y

*Output 2:*
10

In the first example, y introduces a local variable. 
In the second example, y is still a global variable.

This is not consistent to what the official document said.

I tried these examples in JuliaBox.

Reply via email to