MCPcopy Create free account
hub / github.com/Semporia/Scripts / getRandomArrayElements

Function getRandomArrayElements

jd_joy_run.js:541–550  ·  view source on GitHub ↗
(arr, count)

Source from the content-addressed store, hash-verified

539 }
540}
541function getRandomArrayElements(arr, count) {
542 let shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
543 while (i-- > min) {
544 index = Math.floor((i + 1) * Math.random());
545 temp = shuffled[index];
546 shuffled[index] = shuffled[i];
547 shuffled[i] = temp;
548 }
549 return shuffled.slice(min);
550}
551function getFriendPins() {
552 return new Promise(resolve => {
553 $.get({

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected