Hacker News new | ask | show | jobs
by sztanpet 5700 days 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.
1 comments

yeah that is true. most of the time array would not have holes. when it does, using 'table.maxn(...)' works.