4 ms·
You can trivially write your own iterator that starts at 0, and still uses ipairs's (native) iterator internally: function ipairs0(arr) return ipairs(a
by Benjamin_Dobell 6y ago
You can trivially write your own iterator that starts at 0, and still uses ipairs's (native) iterator internally:
function ipairs0(arr)
return ipairs(arr), arr, -1
end