Skip to content

Commit 7f56203

Browse files
authored
Fix table.find library documentation missing optional parameter init (#43)
1 parent 4efb25e commit 7f56203

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_pages/library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ Creates a table with `n` elements; all of them (range `[1..n]`) are set to `v`.
451451
Note that preallocation is only performed for the array portion of the table - using `table.create` on dictionaries is counter-productive.
452452

453453
```
454-
function table.find<V>(t: {V}, v: V): number?
454+
function table.find<V>(t: {V}, v: V, init: number?): number?
455455
```
456456

457-
Find the first element in the table that is equal to `v` and returns its index; the traversal stops at the first `nil`. If the element is not found, `nil` is returned instead.
457+
Find the first element in the table that is equal to `v` and returns its index; the traversal stops at the first `nil`. If the element is not found, `nil` is returned instead. The traversal starts at index `init` if specified, otherwise 1.
458458

459459
```
460460
function table.clear(t: table)

0 commit comments

Comments
 (0)