continue 语句

控制流 / 跳转语句

local numbers = {2, 3, 5, 7, 11, 13, 17, 19}
local taken = {}
for i, number in ipairs(numbers) do
  -- No continue: jump to the label at the end
  if i % 2 == 0 then
    goto continue
  end
  taken[#taken + 1] = number
  ::continue::
end
-- taken = 2, 5, 11, 17

print("taken = " .. table.concat(taken, ", "))