Module:Utils/doc: Difference between revisions
update documentation |
m proofreading |
||
| Line 13: | Line 13: | ||
; <code>table_contains(tbl, value, compare_func)</code>* | ; <code>table_contains(tbl, value, 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 | : 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, value, compare_func)</code>* | ; <code>index_of(array, value, 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 | : 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>* | ||