2020-03-29 13:43:52 +00:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
2021-07-10 21:54:41 +00:00
|
|
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [lengthOf](./js-utils.lengthof.md)
|
2020-03-29 13:43:52 +00:00
|
|
|
|
2021-07-10 21:54:41 +00:00
|
|
|
## lengthOf() function
|
2020-03-29 13:43:52 +00:00
|
|
|
|
2021-07-10 21:54:41 +00:00
|
|
|
Calculate the length of an array or value.
|
2020-03-29 13:43:52 +00:00
|
|
|
|
|
|
|
Arrays return their length, single values return 1, and nil values return 0. This counts the number of elements that setOrPush would add.
|
|
|
|
|
|
|
|
<b>Signature:</b>
|
|
|
|
|
|
|
|
```typescript
|
2021-07-10 21:54:41 +00:00
|
|
|
export declare function lengthOf(val: Maybe<unknown>): number;
|
2020-03-29 13:43:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
2021-07-10 21:54:41 +00:00
|
|
|
| val | [Maybe](./js-utils.maybe.md)<!-- --><unknown> | |
|
2020-03-29 13:43:52 +00:00
|
|
|
|
|
|
|
<b>Returns:</b>
|
|
|
|
|
2020-06-29 23:23:16 +00:00
|
|
|
number
|
2020-03-29 13:43:52 +00:00
|
|
|
|