6 ms·
The length operator(#) is a bit misleading when used with tables, you can only rely on it with array like tables with numeric indexes without holes in them (no
by sztanpet 16y ago
The length operator(#) is a bit misleading when used with tables, you can only rely on it with array like tables with numeric indexes without holes in them (no nil values). Thats a big gotcha one should mention.
- signa11 16y agoyeah that is true. most of the time array would not have holes. when it does, using 'table.maxn(...)' works.