The while loop performs its condition check at the top. If that condition is not met, the loop is skipped.
A variation on the while loop is the ‘repeat until‘ loop.
Lua
local counter = 10
repeat
print(counter)
counter = counter - 1
until counter <= 0
Functionally, the repeat-until loop is identical to the while loop but because the condition is checked at the bottom of the loop, it guarantees that the loop will always run at least once.