hasItems()function

hasItems(items: Iterable<unknown>): boolean
ParamType
itemsIterable<unknown>
The iterable to test. required
Return
boolean
true if the iterable yields at least one item, otherwise false.

Does an iterable have one or more items.

  • Stops as soon as the first item is found, so it never fully consumes the iterable.

Examples

hasItems([1, 2, 3]) // true