tc39 / proposal-iterator.range

A proposal for ECMAScript to add a built-in Iterator.range()

Home Page:https://tc39.es/proposal-iterator.range/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verify isFinite on `from` and `step`

tiansh opened this issue · comments

from and step should be isFinite since you cannot have Number.range(-Infinity, Infinity).

Use Infinity for to should be some how reasonable. But it may not work correctly in most cases due to floating point errors.

Yes, but what should we do when involve from or step is Infinity?

  • Throws?
  • Do we have other choices...?

I prefer throws

Throw RangeError should be the best idea imo.

Closed by 1e4adb4