denoland / denoland/std

random: toShuffled

Open
#6,320 5 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

I thought a shuffle method would update an array in place.

**Describe the solution you'd like**

Two methods: `shuffle` and `toShuffled` (similar to built in methods `reverse` and `toReversed`, `sort` and `toSorted`, etc.): one for updating the array in place and the other for returning a new array.

**Describe alternatives you've considered**

Extracting the implementation and maintaining my own in-place shuffle method. That would not be ideal though.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.