WoW:API getn: Difference between revisions
Jump to navigation
Jump to search
m
Added # operator
(see also: tcount) |
m (Added # operator) |
||
| Line 15: | Line 15: | ||
10 | 10 | ||
> = table.getn({1,2,3,nil,5,6}) -- sequence ends at element 3 due to nil value at 4 | > = table.getn({1,2,3,nil,5,6}) -- sequence ends at element 3 due to nil value at 4 | ||
3 | |||
Note that Lua 5.1 supports the use of the # operator. #t is syntactic sugar for table.getn(t) | |||
> print( #{1,2,3} ) | |||
3 | 3 | ||