Fully Support
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
I'm really cheering for the slice-notation range extension proposed in
https://github.com/tc39/proposal-slice-notation/issues/19#issuecomment-421453934
```js
for (const i of Number.range(0, 43)) {
console.log(i) // 0 to 42
}
const fakeData = [...Number.range(1, 21)].map(x => x ** 2)
```
Hello everyone, I made a formal proposal
https://github.com/Jack-Works/proposal-Number.range , welcome to disscuss
the details in the repo!
On Thu, Nov 29, 2018 at 3:01 PM Jordan Harband wrote:
> It's not a "standard library" unless every part of it has gone through a
> full standards process.
cf https://github.com/tc39/proposal-slice-notation/issues/19 which would be
more powerful as a literal
On Thu, Nov 29, 2018 at 8:01 AM Jordan Harband wrote:
> It's not a "standard library" unless every part of it has gone through a
> full standards process.
>
> On Wed, Nov 28, 2018 at 8:31 PM
It's not a "standard library" unless every part of it has gone through a
full standards process.
On Wed, Nov 28, 2018 at 8:31 PM Jacob Pratt wrote:
> I'm not saying we should add it on to that proposal, but rather saying
> that I think more effort should be put into a standard library where
I'm not saying we should add it on to that proposal, but rather saying that
I think more effort should be put into a standard library where things like
this don't need to go through a full standards process. That's just my
opinion, and borderline on-topic for this specific suggestion.
I'm
Oh, I'm not here to find out how to implement a range in detail. That's the
trivial things, I want to first make it become a stage 0 proposal, then we
can discuss if we need some overload or how to deal with the edge cases.
Ps, does Pratt mean we should add it as a standard library in the stage 1
Quick, simple TypeScript range function (with overloads, of course).
```
export function range(end: number): IterableIterator;
export function range(start: number, end: number): IterableIterator;
export function range(start: number, end: number, step: number):
IterableIterator;
export function*
I end up writing a range function in virtually every project I use, so
yeah, I think this is worthwhile.
My own preferences, based on Python precedence:
Number.range(end) === Number.range(0, end, 1)
Number.range(start, end) === Number.range(start, end, Math.sign(end-start))
Number.range(start,
Hello everyone.
I've searched for the mailing list, there are some discussions add `new
Range` or `a ... b` into the language but not become a formal proposal.
I've made a full demo(polyfill) these days. Anyone interested?
Preview: `for (let i of Number.range(1, 5)) console.log(i)`
And there is
10 matches
Mail list logo