We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-- nils don't count local list = {} list[0] = nil list[1] = "item"
print(#list) -- 0 print(select('#', list)) -- 1
The text was updated successfully, but these errors were encountered:
Yes, moreover I think the example is actually wrong. #list will be 1 here...
#list
Sorry, something went wrong.
fixes Olivine-Labs#6, Olivine-Labs#7 and Olivine-Labs#8
8997401
- better explanation of the length operator - no functions in table constructors - spaces after { and before }
Another note for this (several years later) is that the use of select is misleading here.
select
select has nothing to do with tables, of course passing in list as the second parameter is going to yield 1!
list
1
Yes, I removed it in my commit (several years ago) :)
No branches or pull requests
-- nils don't count
local list = {}
list[0] = nil
list[1] = "item"
print(#list) -- 0
print(select('#', list)) -- 1
The text was updated successfully, but these errors were encountered: