Tim Williams
Feb 23, 2022

--

Agreed, Math.random() is not so random, this may be a better approach:

const shuffleArray = (arr) => arr.sort(() => crypto.getRandomValues(new Uint8Array(1))[0] - 127.5)

--

--

Tim Williams
Tim Williams

Written by Tim Williams

I am a Web Developer passionate about new technologies, as well as time tested best practices (here’s looking at you Uncle Bob).

Responses (2)