Skip to content

[Meta] Array.prototype.shuffle #33

Open

Description

@AurelioDeRosa

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.

Activity

  1. ljharb commented on May 22, 2016

    @ljharb

    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?

  2. AurelioDeRosa commented on May 22, 2016

    @AurelioDeRosa
    CollaboratorAuthor

    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).

  3. leobalter commented on Jul 18, 2016

    @leobalter
    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.

  4. leobalter commented on Sep 6, 2016

    @leobalter
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions