#help with functions/if statements
17 messages · Page 1 of 1 (latest)
Did you delete it or already solved ?
i didnt delete it?
they told me it was the wrong channel so i made a poist here
Click on your sourcebin link
It's dead
That's what I was referring to
@wise forum
let puzzleWords = ['coding' || 'keyboard' ]
function randomizeWords(words) {
let randomizeWord = [];
for (let i = 0; i < words.length; i++) {
let word = puzzleWords[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;
}
let randomizedWord = randomizeWords(puzzleWords)
const embed = new EmbedBuilder()
.setDescription(`${randomizedWord}`)
interaction.reply({ embeds: [embed] })
Any errors ?
Lemme read the code rq
no errors im just asking how to get the correctly spelled word to show like in my console
Number 1: Array objects are separated using a comma ,
not the or operator ||
Other than that I have to apologize because I can't process that rn 
Maybe someone else is better suited than me to actually say if it's working or not
i want a single word scrambled at a time, not both. thats why its ||