Yes, thank you…
Of course, the value of x is still known inside the block until it is reassigned…
x = 1
IO.puts x
if true do
IO.puts x
x = 2
IO.puts x
end
IO.puts x
# Prints: 1, 1, 2, 1
Hal
Yes, thank you…
Of course, the value of x is still known inside the block until it is reassigned…
x = 1
IO.puts x
if true do
IO.puts x
x = 2
IO.puts x
end
IO.puts x
# Prints: 1, 1, 2, 1
Hal