function randomizeWords(words) { let randomizeWord = []; for (let i = 0; i < words.length; i++) { let word = words[i]; let scrambledWord = ""; while (word.length > 0) { let index = Math.floor(Math.random() * word.length); scrambledWord += word[index]; word = word.substring(0, index) + word.substring(index + 1); } randomizeWord.push(scrambledWord); } return randomizeWord; } console.log(randomizeWords(words)); if (scrambledWord === 'keyboard') { interaction.reply('keyboard') }