MCPcopy Index your code
hub / github.com/nodejs/node / shuffleArray

Function shuffleArray

benchmark/assert/deepequal-set.js:26–33  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

24});
25
26function shuffleArray(array) {
27 for (let i = array.length - 1; i > 0; i--) {
28 const j = Math.floor(Math.random() * (i + 1));
29 const temp = array[i];
30 array[i] = array[j];
31 array[j] = temp;
32 }
33}
34
35function benchmark(method, n, values, values2, order) {
36 const actual = new Set(values);

Callers 1

benchmarkFunction · 0.70

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…