({ exactly, join }: { exactly: number; join: string })
| 3 | } |
| 4 | |
| 5 | function randomWords({ exactly, join }: { exactly: number; join: string }): string { |
| 6 | const words: string[] = []; |
| 7 | |
| 8 | for (let i = 0; i < exactly; i++) { |
| 9 | let nextWord = randomWord(); |
| 10 | |
| 11 | // Make sure the word is not already in the list |
| 12 | while (words.includes(nextWord)) { |
| 13 | nextWord = randomWord(); |
| 14 | } |
| 15 | |
| 16 | words.push(nextWord); |
| 17 | } |
| 18 | |
| 19 | return words.join(join); |
| 20 | } |
| 21 | |
| 22 | var wordList = [ |
| 23 | // Borrowed from xkcd password generator which borrowed it from wherever |
no test coverage detected
searching dependent graphs…