4.3.2 - while

As usual, Lua first tests the while condition; if the condition is false, then the loop ends; otherwise, Lua executes the body of the loop and repeats the process.

    local i = 1
    while a[i] do
      print(a[i])
      i = i + 1
    end