Keith Cirkel

Results 469 comments of Keith Cirkel

Sorry I missed the OP somehow. If anyone would like to tackle this as a contribution, PRs are welcome!

I really like this, it can provide a great deal of flexibility in getting first/last elements, I could imagime it being used like `[first, second, ..., last] = iterable`. My...

> I’d also expect to be able to put a binding there and collect the third through penultimate items. I assume you mean converting it to `[first, second, ...some, last]`,...

The spec proposal does not currently reflect this, calling `arr.lastItem = "kitty"` would throw. We could amend the spec proposal to not throw - so `arr.lastItem = "kitty"` would set...

Agreed. I'd rather throw but webcompat would probably force otherwise. However `lastItem` as a getter/setter may be dropped given concerns from the March TC39 meeting - instead opting for a...

I would be interested in gathering use cases for setting also. I'm personally happy with just the getter. Perhaps @domenic who spoke about a getter/setter combo in the January 2018...

Intuitively I agree with you @domenic but when pushed by @syg to come up with a concrete use case I struggle.

Does `arr[arr.lastIndex] = 4` not suffice?

I'm not sure assignment has a convincing enough use case to warrant being specced. See https://github.com/tc39/proposal-array-last/issues/16

This is just to propose the solution of array-last. The idea is to open the discussion about values such as `array[:-N]` but to try to avoid any scope creep about...