Function: count()
count<
Value
>(iterable
):number
Returns the number of values in iterable
.
Like Array.prototype.length
, but for iterables.
Type Parameters
• Value
Parameters
• iterable: Iterable
<Value
, any
, any
>
Returns
number
Example
console.log(count([`sloth`, `more sloth`, `even more sloth`]))
//=> 3