Shuffle an array in js
javascript
const shuffleArray = arr =>
arr.sort(() => Math.random() - 0.5)
Post-Meta
- Published: July 15, 2019
- Last modified: July 15, 2019
You can search all my notes here
const shuffleArray = arr =>
arr.sort(() => Math.random() - 0.5)
Comments