docs + notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-03-28 15:21:41 +03:00
parent f1a2b39c03
commit 1b4f900c22

View File

@ -1115,6 +1115,10 @@ XXX .reduce(..) can return a non-iterable -- test and document this case...
-> <generator>
```
<!-- XXX check this
This does not support negative indexes.
-->
Equivalent to `Array`'s `.slice(..)` but will return a generator instead of an
array, for more info see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
@ -1206,7 +1210,8 @@ This is equivalent to `[...<generator>]` but more suited for the concatenative s
### Generator constructor iteration
This API is essentially the same as [generator iteration](#generator-instance-iteration)
but will return a reusable generator _pipeline_ instead of a generator
with some minor omissions, but will return a reusable generator _pipeline_
instead of a generator.
```javascript
var sumOdds = generator.iter
@ -1216,6 +1221,7 @@ var sumOdds = generator.iter
return r + e }, 0)
.pop()
// sumOdds(..) is essentially a function that can be reused...
console.log(sumOdds([1, 2, 3])) // -> 4
console.log(sumOdds([1, 2, 3, 4, 5, 6, 7])) // -> 16
```
@ -1234,6 +1240,11 @@ console.log(sumOdds([1, 2, 3])) // -> 4
console.log(sumOdds([1, 2, 3, 4, 5, 6, 7])) // -> 16
```
<!--
XXX only list the differences + reference to the above...
-->
#### `<Generator>.at(..)`
#### `<Generator>.shift()` / `<Generator>.pop()`