KEMBAR78
`Random.pop(coll)`? · Issue #12 · tc39/proposal-random-functions · GitHub
Skip to content

Random.pop(coll)? #12

@tabatkins

Description

@tabatkins

Would it be useful to have a Random.pop(), that returns a single random item from a collection (specifically a built-in collection, I guess - Array/Map/Set), and mutates the collection to remove that item?

(The fact that Map/Set don't have .pop() has annoyed me occasionally.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions