docs and notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-09 11:25:10 +03:00
parent 934e3dd216
commit f160c78eaa
2 changed files with 5 additions and 3 deletions

View File

@ -100,7 +100,7 @@ Library of JavaScript type extensions, types and utilities.
- [`<generator>.iter(..)`](#generatoriter-1)
- [`<generator>.map(..)` / `<generator>.filter(..)`](#generatormap--generatorfilter)
- [`<generator>.reduce(..)` / `<generator>.greduce(..)`](#generatorreduce--generatorgreduce)
- [`<generator>.forEach(..)`](#generatorforeach)
- [`<generator>.forEach(..) (EXPERIMENTAL)`](#generatorforeach-experimental)
- [`<generator>.slice(..)`](#generatorslice)
- [`<generator>.at(..)` / `<generator>.gat(..)`](#generatorat--generatorgat)
- [`<generator>.flat(..)`](#generatorflat)
@ -2136,7 +2136,7 @@ XXX .reduce(..) can return a non-iterable -- test and document this case...
...compare with Array.prototype.reduce(..)
-->
#### `<generator>.forEach(..)`
#### `<generator>.forEach(..)` (EXPERIMENTAL)
```bnf
<generator>.forEach(<func>)

View File

@ -223,7 +223,8 @@ object.Mixin('GeneratorMixin', 'soft', {
reduce: makeGenerator('reduce'),
reduceRight: makeGenerator('reduceRight'),
// XXX add .toString(..) ???
// XXX EXPERIMENTAL
// XXX add .toString(..) to this???
forEach: function(func){
var that = this
return function(){
@ -406,6 +407,7 @@ object.Mixin('GeneratorProtoMixin', 'soft', {
// NOTE: this is a special case in that it will unwind the generator...
// NOTE: this is different from <array>.forEach(..) in that this will
// return the resulting array.
// XXX EXPERIMENTAL
forEach: function(func){
return [...this].map(func) },