Update library.md

Update guidance
This commit is contained in:
Arseny Kapoulkine 2023-02-27 12:20:09 -08:00 committed by GitHub
parent 6b2cbbbc00
commit 90e14aaa0c
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -374,19 +374,19 @@ Concatenate all elements of `a` with indices in range `[f..t]` together, using `
function table.foreach<K, V, R>(t: { [K]: V }, f: (K, V) -> R?): R?
```
Iterates over all elements of the table in unspecified order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code.
Iterates over all elements of the table in unspecified order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code; use `for` loop instead.
```
function table.foreachi<V, R>(t: {V}, f: (number, V) -> R?): R?
```
Iterates over numeric keys of the table in `[1..#t]` range in order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code.
Iterates over numeric keys of the table in `[1..#t]` range in order; for each key-value pair, calls `f` and returns the result of `f` if it's non-nil. If all invocations of `f` returned `nil`, returns no values. This function has been deprecated and is not recommended for use in new code; use `for` loop instead.
```
function table.getn<V>(t: {V}): number
```
Returns the length of table `t` (equivalent to `#t`). This function has been deprecated and is not recommended for use in new code.
Returns the length of table `t`. This function has been deprecated and is not recommended for use in new code; use `#t` instead.
```
function table.maxn<V>(t: {V}): number