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)
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)
I am a Web Developer passionate about new technologies, as well as time tested best practices (here’s looking at you Uncle Bob).