length
优质
小牛编辑
135浏览
2023-12-01
Returns the length of the sequence.
Signature
ArrayLikeSequence.length = function() { /*...*/ }
ArrayLikeSequence.length = function length() { return this.parent.length(); }
Name | Type(s) | Description |
---|---|---|
returns | number | The length. |
Examples
function increment(x) { return x + 1; } Lazy([]).length() // => 0 Lazy([1, 2, 3]).length() // => 3 Lazy([1, 2, 3]).map(increment).length() // => 3