Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Conversation

rauschma
Copy link
Contributor

@rauschma rauschma commented Dec 9, 2022

IINM, that method was removed from the proposal.

@bergus
Copy link

bergus commented Dec 10, 2022

Can we please add .indexed() back to the proposal instead? There was no good reason for removing it.

@Josh-Cena
Copy link

Josh-Cena commented Dec 10, 2022

See #211

@bergus
Copy link

bergus commented Dec 10, 2022

@Josh-Cena Yes, I saw #211 (comment). But while adding the second argument received "mixed feedback", removing .indexed() received opposition, and there were no arguments brought forward. Or did I miss some TC39 meeting discussion?

@ljharb
Copy link
Member

ljharb commented Dec 10, 2022

@bergus the proposal is now stage 3, as-is, so it's unlikely any changes will be made that aren't motivated by feedback that could only be gleaned from implementation.

As I recall, counter was a replacement for .indexed, and there was opposition to both forms existing.

@michaelficarra
Copy link
Member

@bergus indexed is very easy to reproduce given the counter argument of map, so is far less motivated now. It can always be pursued as a separate proposal, but no longer made sense in this "obvious" initial set.

Iterator.prototype.indexed = function() {
	return this.map((elem, counter) => [counter, elem]);
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants