countItems()function

countItems(items: Iterable<unknown>): number
ParamType
itemsIterable<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