Proposal: Array.prototype.shuffle (Fisher-Yates)

Alexander Lichter es at lichter.io
Sun Apr 29 12:58:29 UTC 2018


Hey all!

Though this proposal was created more than five years ago, it's still 
something that should be standardized.

As the algorithm is known and an implementation wouldn't take ages, 
bringing in Array.prototype.shuffle is a low-hanging fruit.

Furthermore, it helps to provide a "real" random shuffle mechanism, 
keeping people away from trying to do implement their own (biased or 
wrong) algorithm (see https://stackoverflow.com/a/18650169/3975480 for 
example).



More information about the es-discuss mailing list