2020-08-20 02:05:34 +02:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.shuffleArray = void 0;
|
|
|
|
function shuffleArray(inputArray) {
|
2020-08-18 14:04:33 +02:00
|
|
|
const array = inputArray.slice();
|
|
|
|
for (let i = array.length - 1; i > 0; i--) {
|
|
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
|
|
const x = array[i];
|
|
|
|
array[i] = array[j];
|
|
|
|
array[j] = x;
|
|
|
|
}
|
|
|
|
return array;
|
|
|
|
}
|
2020-08-20 02:05:34 +02:00
|
|
|
exports.shuffleArray = shuffleArray;
|
2020-08-18 14:04:33 +02:00
|
|
|
//# sourceMappingURL=shuffleArray.js.map
|