Skip to content

Commit

Permalink
MOD when to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rhirano0715 committed Mar 18, 2023
1 parent e474bd8 commit 393be85
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@
})
.catch(error => console.error(error));

const nounList = wordList.filter(word => word.type === 'noun');
const particleList = wordList.filter(word => word.type === 'particle');
const verbList = wordList.filter(word => word.type === 'verb');

console.log(nounList);
console.log(particleList);
console.log(verbList);

setInterval(() => {
const textContainer = document.getElementById("text-container");

// Filter the array to get only the words with the desired types
// const filteredList = wordList.filter(word => word.type === 'noun' || word.type === 'verb' || word.type === 'particle');
const nounList = wordList.filter(word => word.type === 'noun');
const particleList = wordList.filter(word => word.type === 'particle');
const verbList = wordList.filter(word => word.type === 'verb');

console.log(nounList);
console.log(particleList);
console.log(verbList);

// Select a random word from the filtered list
const noun = nounList[Math.floor(Math.random() * nounList.length)];
Expand Down

0 comments on commit 393be85

Please sign in to comment.