Being relatively new to JavaScript (I've been studying for about a week), I am facing a challenge in figuring out how to determine if an array contains a specific string. Here, you can find the word-guessing game that I created.
The 'contains' function is defined like this:
function contains(word, list){
if(word in list){
return true;
}
else {
return false;
}
};
Despite my efforts, I always end up with a false value and I'm not sure what I'm missing.
I attempted to implement both the third technique mentioned here and the recommended technique illustrated here, but encountered the same issue.
If anyone could provide some assistance, it would be greatly appreciated!