1
0
Fork 0
js-utils/docs/api/js-utils.lengthof.md

27 lines
684 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [@apextoaster/js-utils](./js-utils.md) &gt; [lengthOf](./js-utils.lengthof.md)
## lengthOf() function
Calculate the length of an array or value.
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
export declare function lengthOf(val: Maybe<unknown>): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| val | [Maybe](./js-utils.maybe.md)<!-- -->&lt;unknown&gt; | |
<b>Returns:</b>
number