mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
docs and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
934e3dd216
commit
f160c78eaa
@ -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>)
|
||||
|
||||
@ -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) },
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user