
If you need to shuffle the elements of an array, you can use this simple function: function shuffle(array) { const copy = [...array] return copy.sort(() => Math.random() - 0.5) } The algorithm Creates a copy of the parameter to not modify the ...
Software Developer | Back-end
Markdown supported · ⌘↵ to post
No responses yet.