instead of doing
print("hi")
they do
do
print("hi")
end
instead of doing
print("hi")
they do
do
print("hi")
end
It controls the scope, so if you define a variable inside a do - end block, it will nil outside the block.
local x = "foo"
do
local y = "bar"
print(x) -- foo
print(y) -- bar
end
print(x) -- foo
print(y) -- nil