For indexed arrays (like in your case) prefer using the numeric for-loop (you can use the # table operator as the limit here). Use ipairs if you have deeply nested arrays or if it makes the code more readable (the second part of this sentence is hardly an argument as you can use local values or upvalues here). Use either "next, t" or "pairs(t)" for associative arrays only (MunkDev's last example should have used either numeric for or ipairs instead of pairs for efficiency reasons)
|