Having trouble identifying a word that is not in my word list, I keep encountering this error: Uncaught TypeError: Cannot read properties of undefined (reading 'includes') at handleKeyup
Included in my bigwords.js file is the following:
var words = [
{"id": 1, "word": "abbreviate"},
{"id": 2, "word": "bamboozled"},
{"id": 3, "word": "calculator"},
{"id": 4, "word": "disrespect"}
]
I have an if statement that verifies whether the word is absent from the object.
if (!(words.includes(currentGuess))) {
document.getElementById('tip').innerHTML = "Word not in dictionary";
console.log('word not contained in dictionary')
return
}
I've attempted various methods to rewrite this without using .includes but haven't found success yet. My goal is for the code to run only if currentGuess does not match any of the words in the list. Thank you!