Skip to content

Implement random.choice() #76

@Smoren

Description

@Smoren

Generate random selections from an array of values.

If optional param repetitions not given then iterate infinitely.

function *choice<T>(items: Array<T>, repetitions?: number): Iterable<T>

PHP implementation example

Needs to be implemented:

  • random.choice()
  • random.choiceAsync()
  • Stream.choice()
  • AsyncStream.choice()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions