(size)
| 2 | |
| 3 | const selectRandom = (array) => array[Math.floor(Math.random() * array.length)]; |
| 4 | const selectRandomSlice = (size) => (array) => { |
| 5 | const slice = []; |
| 6 | while (slice.length < size && slice.length < array.length) { |
| 7 | const toSelect = selectRandom(array); |
| 8 | if (!slice.includes(toSelect)) { |
| 9 | slice.push(toSelect); |
| 10 | } |
| 11 | } |
| 12 | return slice; |
| 13 | }; |
| 14 | |
| 15 | class AsyncGoon extends React.Component { |
| 16 | constructor(props) { |
no test coverage detected