I understand that the for loops are now local in Julia. But there is something I do not understand. Please consider the following two examples.
Example 1
a = 0
for i = 1:3
a += 1
end
Example 2
a = [0]
for i = 1:3
a[1] += 1
end
Example 1 throws an error message, which I understand. But Example 2 works as it is expected. How should I understand this? Arrays are not variables? Can somebody explain this to me?