countItems()function
countItems(items: Iterable<unknown>): number
| Param | Type | |
|---|---|---|
items | Iterable<unknown> | The iterable to count. required |
| Return | |
|---|---|
number | The number of items yielded by the iterable. |
Count the number of items in an iterable.
- Fully consumes the iterable to count its iterations.
Examples
countItems([1, 2, 3]) // 3