()
| 11 | |
| 12 | let unusedPageTitles: string[] = []; |
| 13 | export const getRandomPageTitle = (): string => { |
| 14 | if (unusedPageTitles.length === 0) { |
| 15 | unusedPageTitles = clone(pageTitles); |
| 16 | } |
| 17 | |
| 18 | const indexToRemove = Math.floor(Math.random() * unusedPageTitles.length); |
| 19 | return unusedPageTitles.splice(indexToRemove, 1)[0]; |
| 20 | }; |
| 21 | |
| 22 | let unusedWikipediaFacts: string[] = []; |
| 23 | export const getRandomWikipediaFact = (): string => { |