How to stop code in loop without breaking loop

Lets say i have a loop like this

for i = 1, 3 do
    print(i)
end

--output
-- 1
-- 2
-- 3

what i want is to not print the second time like this:

for i = 1, 3 do
    if i == 2 then
        --something that prevents the code from going further
    end
    
    --if i is 2 then this wont happen
    print(i)
end

-- output
-- 1
-- 3

this would be similar to returning nothing in a function

stay = true

function someFunction()
    print("Hello world!")
    if stay == true then return end

    --further code will not run
    print("Goodbye world!")
end

there is a solution to this, but i dont like the extra indentation and would like to know if there is a way to do this without the extra indentation
(solution with extra indentation)

for i = 1, 3 do
    if i ~= 2 then
        print(i)
    end
end

-- output
-- 1
-- 3

Luau should support continue

for i = 1, 3 do
    if i == 2 then
        continue
    end
    
    --if i is 2 then this wont happen
    print(i)
end

-- output
-- 1
-- 3
2 Likes

Thank you, I had been searching for this for a while