Module:Util/tables/len/Documentation/Spec: Difference between revisions
From Zelda Wiki, the Zelda encyclopedia
no edit summary
PhantomCaleb (talk | contribs) No edit summary |
PhantomCaleb (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
return { | return { | ||
params = {"tbl"}, | params = {"tbl"}, | ||
returns = "The length of the array | returns = "The length of the array component of <code>tbl</code>. Unlike the <code>#</code> operator, this function works with {{Scribunto Manual|frame.args}} and tables loaded via {{Scribunto Manual|mw.loadData}}.", | ||
cases = { | cases = { | ||
{ | { | ||
args = {{1, 2, 3, [10] = 10}}, | args = {{1, 2, 3, [10] = 10}}, | ||
expect = 3, | expect = 3, | ||
}, | |||
{ | |||
args = {{ foo = "bar" }}, | |||
expect = 0 | |||
}, | }, | ||
}, | }, |