View Single Post
12-18-19, 05:43 AM
Join Date: Apr 2007
When dealing with sequential numbers as keys, the table is an array. Using table.insert and table.remove shifts the array to accommodate what you inserted or removed. The number 100 (not string) was at index 1, but when you inserted 500 at that position, it moved 100 to index 2. Anything dealing with arrays ignores keys that aren't sequential up from 1, which also means index 0 and negative indexes are also ignored.
The #t operation counts the array part of the table. The last part of your example makes #t == 2, since "a" is ignored.
Lua Wall of Shame
Don't like combat text on frames?
Last edited by Kanegasi : 12-18-19 at
View Public Profile
Send a private message to Kanegasi
Find More Posts by Kanegasi