Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Meta] Array.prototype.shuffle #33

Open
AurelioDeRosa opened this issue May 22, 2016 · 4 comments
Open

[Meta] Array.prototype.shuffle #33

AurelioDeRosa opened this issue May 22, 2016 · 4 comments
Labels

Comments

@AurelioDeRosa
Copy link
Collaborator

I'd like to discuss and eventually propose the introduction of an Array.prototype.shuffle method. I think this is a method used in several context and helpful in many cases including but not limited to games.

Before creating a repository with a more formal proposition, I'd like to discuss the idea with the group and gather some feedback.

@ljharb
Copy link

ljharb commented May 22, 2016

There's some useful info on esdiscuss. I'd also expect discussion about the randomness of the shuffle - would it be tied to Math.random, whose entropy is pretty underspecified?

@AurelioDeRosa
Copy link
Collaborator Author

Since the discussion was abandoned, I'd like to revamp it. I agree with the author of the post in saying that the algorithm should use the Fisher-Yates algorithm as PHP (and probably other languages do).

@leobalter
Copy link
Collaborator

@AurelioDeRosa I haven't said much but I'm planning to talk to the other TC39 representatives in the next meeting to get more insights about it, as they might have more background for these features from other discussions. Just like @ljharb mentioned esdiscuss already serves as a starting point, but it's not one of the best tools for discovery.

@leobalter
Copy link
Collaborator

I've talked about this in the last meeting and it's pretty clear the group does not want to extend Array and Object unless it's really necessary.

Being able to implement it in a helper method (through some sort of shim code) lowers the needed value for it.

I understand it's frustrating to block this, but it will be hard to move this forward in the consensus process.

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

No branches or pull requests

3 participants