Module:Utils/doc: Difference between revisions
m proofreading |
m wording |
||
| 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> | : 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>, which returns <code>true</code> if <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> | : 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>, which returns <code>true</code> if <code>value</code> and an element in <code>tbl</code> have the same value. | ||
; <code>value_provided(s)</code>* | ; <code>value_provided(s)</code>* | ||