I have been very stuck on a bonus task from a tutorial, which is to remove every other word (contained in the array overusedWords
) from the main passage betterWords
(a long array of words making up a story).
For reference:
let overusedWords = ['really', 'very', 'basically'];
Focusing just on the word 'really'
, here is what I have come up with, with no success so far.
for (let word of betterWords) {
if (word === 'really' && word % 2 !== 0) {
betterWords.splice(word, 1)
}
}
Any advice welcome, thank you
question from:
https://stackoverflow.com/questions/65875625/removing-every-other-word-from-an-array-passage-of-text 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…