I find that when I do this:
local array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
for i, v in pairs(array) do
print(v)
if v == 10 then
table.clear(array)
end
end
The output shows this:
1
2
3
4
5
6
7
8
9
10
Then I do a second try by using break and it gives me the same result.
So I’m confused that if I can use table.clear() instead of break to break the loop