DEV Community

loading...

Discussion on: Simple snippet to shuffle array

Collapse
pentacular profile image
pentacular

It also breaks down when there are key collisions.

Sorting by non-unique keys is not shuffling.

Fisher-Yeats is trivial to implement and theoretically correct -- use that instead.