Module:Utils/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
update documentation
Ganaram inukshuk (talk | contribs)
m proofreading
Line 13: Line 13:


; <code>table_contains(tbl,&nbsp;value,&nbsp;compare_func)</code>*
; <code>table_contains(tbl,&nbsp;value,&nbsp;compare_func)</code>*
: Check whether table contains <code>value</code>. Passing in <code>compare_func</code> is optional; if <code>value</code> is a table and <code>tbl</code> a table of tables, pass in a comparison function <code>compare_func</code> to determine whether <code>value</code> and an element in <code>tbl</code> have the same value.<code>tbl</code> have the same value.
: Check whether table contains <code>value</code>. Passing in <code>compare_func</code> is optional; if <code>value</code> is a table and <code>tbl</code> a table of tables, pass in a comparison function <code>compare_func</code> to determine whether <code>value</code> and an element in <code>tbl</code> have the same value.


; <code>index_of(array,&nbsp;value,&nbsp;compare_func)</code>*
; <code>index_of(array,&nbsp;value,&nbsp;compare_func)</code>*
: Return the first index with the given <code>value</code> (or nil if not found). Passing in <code>compare_func</code> is optional; if <code>value</code> is a table and <code>tbl</code> a table of tables, pass in a comparison function <code>compare_func</code> to determine whether <code>value</code> and an element in <code>tbl</code> have the same value.<code>tbl</code> have the same value.
: Return the first index with the given <code>value</code> (or nil if not found). Passing in <code>compare_func</code> is optional; if <code>value</code> is a table and <code>tbl</code> a table of tables, pass in a comparison function <code>compare_func</code> to determine whether <code>value</code> and an element in <code>tbl</code> have the same value.


; <code>value_provided(s)</code>*
; <code>value_provided(s)</code>*