Kevin Gibbons

Results 638 comments of Kevin Gibbons

> I agree with that behavior and believe that is coherent with what I’m proposing. Given that, maybe it would make more sense for the Generator prototype to override the...

Ah, I think you want [`toAsync`](https://github.com/tc39/proposal-iterator-helpers/issues/160), which lifts a sync iterator into an async iterator. ```js await Number.range(100).toAsync().forEach(async job => { // some async work to perform serially }); ```...

@ptomato `forEach` needs to eagerly consume the rest of the iterator; that's what it's for. So it can't really return another iterator. You want `.tap`, discussed some [in this thread](https://github.com/tc39/proposal-iterator-helpers/issues/13#issuecomment-459543562).

> Why it should not be ignored in `.forEach`, but `.map` should ignore it and return `{ value: undefined, done: true }`? I'm not totally sure that it _shouldn't_ be...

The editors need to review it, which will take a while because it's a substantial change.

Re: handling of NaN, see https://github.com/tc39/proposal-iterator-helpers/issues/169. This was also mentioned during [the presentation in July](https://docs.google.com/presentation/d/1T7uVl-GtpTPgNY0psvFoVm0v22_tLoz2o-vVjlTZvoY/edit#slide=id.g13c1a729893_0_98).

> Iterator.prototype.reduce Step 3.b - I find it surprising that reduce will throw if there is no initialValue and the iterator is empty, since Array.prototype.reduce does not throw. `[].reduce(x =>...

The motivations for passing an index seem stronger to me, when laid out like this. There is almost no downside, and avoiding a bunch of extra intermediate objects is a...

> indexes on an iterator is a category error. No? There is a first thing you get out of the iterator, a second thing you get out of the iterator,...

> However, this case should be covered by the spec Sure. The behavior will be that the spec counts by math integers and then casts to a double, so once...