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
function table.countvalues(t) local counts = {} for t as elm do counts[elm] = (counts[elm] ?? 0) + 1 end return counts end
The text was updated successfully, but these errors were encountered:
Could consider table.values() instead that returns an array of values
Sorry, something went wrong.
Wdym?
local assert = require("assert") local t = { a = 1, b = 2, c = 3 } assert.equals({ 1, 2, 3 }, t:values())
Then you could query for length if you needed.
How does that solve this?
No branches or pull requests
The text was updated successfully, but these errors were encountered: