(arr, count)
| 539 | } |
| 540 | } |
| 541 | function 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 | } |
| 551 | function getFriendPins() { |
| 552 | return new Promise(resolve => { |
| 553 | $.get({ |