MCPcopy
hub / github.com/phaserjs/phaser / Shuffle

Function Shuffle

src/utils/array/Shuffle.js:22–33  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

20 * @return {T[]} The shuffled array.
21 */
22var Shuffle = function (array)
23{
24 for (var i = array.length - 1; i > 0; i--)
25 {
26 var j = Math.floor(Math.random() * (i + 1));
27 var temp = array[i];
28 array[i] = array[j];
29 array[j] = temp;
30 }
31
32 return array;
33};
34
35module.exports = Shuffle;

Callers 1

RangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…