Merge branch 'master' of github.com:flynx/types.js

This commit is contained in:
Alex A. Naanou 2021-05-08 23:22:45 +03:00
commit e7d785900d
2 changed files with 6 additions and 10 deletions

View File

@ -1640,8 +1640,8 @@ Equivalents to `Array`'s `.map(..)`, `.filter(..)` and `.reduce(..)` but return
generators that yield the handler return values.
<!--
XXX doc all differences (revise)
XXX .reduce(..) can return a non-iterable -- test and document this case...
...compare with Array.prototype.reduce(..)
-->
@ -1654,15 +1654,11 @@ XXX .reduce(..) can return a non-iterable -- test and document this case...
-> <generator>
```
<!-- XXX -->
Note that this does not support negative indexes as it not possible to know the
generator length until it is fully done.
<!-- 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:
Otherwise this is similar 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

View File

@ -180,7 +180,7 @@ object.Mixin('GeneratorProtoMixin', 'soft', {
// NOTE: this is different from Array's .slice(..) in that it does not
// support negative indexes -- this is done because there is no way
// to judge the length of a generator untill it is fully done...
// to judge the length of a generator until it is fully done...
slice: function*(from=0, to=Infity){
// sanity check...
if(from < 0 || to < 0){