1 line of code: How to shuffle an array
const shuffle = arr =&gt; [...arr].sort(() =&gt; 0.5 - Math.random());        Enter fullscreen mode ...
Tags: javascript, webdev, programming, codequality