MCPcopy Create free account
hub / github.com/idank/explainshell / shuffle

Function shuffle

explainshell/web/static/js/es.js:53–60  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

51}
52
53function shuffle(arr) {
54 const a = arr.slice();
55 for (let i = a.length - 1; i > 0; i--) {
56 const j = Math.floor(Math.random() * (i + 1));
57 [a[i], a[j]] = [a[j], a[i]];
58 }
59 return a;
60}
61
62function setStyles(els, styles) {
63 for (const el of els) Object.assign(el.style, styles);

Callers 1

assigncolorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected