Number guesser

hi I need help with my number guesser project I am on part 5 and it is printing the error message
here is what it is asking me to do:

Create an updateScore() function. This function will be used to correctly increase the winner’s score after each round.

This function:

  • Has a single parameter. This parameter will be a string value representing the winner.
  • Increases the score variable ( humanScore or computerScore ) by 1 depending on the winner passed in to updateScore . The string passed in will be either 'human' or 'computer' .
  • Does not need to return any value.

here is my code:

const generateTarget = Math.floor(Math.random()*9)
const compareGuesses = (userGuess, computerGuess, targetNumber) => {
if (computerGuess === userGuess) {
return true
} else if (computerGuess > userGuess && userGuess > targetNumber){
return true
} else if (computerGuess < userGuess && userGuess > targetNumber){
return true
} else {
return false
if (winner === ‘human’) {
} else {

thank you!

the error message? which error message is that?
usually an error message says something about what’s wrong and is exactly what you’d want to investigate
if the message is from codecademy then … they’re not always too careful about matching what happened with what they say happened, often testing one thing and then saying something else, but it might still say something that can be used

your code runs in your browser (it’s a web page …) so you would want to keep an eye on your error log, your browser’s console so that if the code crashes, you would see the error message for that

ok thanks but did you see anything wrong with my code?

I don’t read code in hopes of trying to find a problem.

I’d reproduce the already found problem and follow the problem to its cause.
Since you’re running it in the context of an exercise I’d need the exercise link and I’d need an exact copy of your code, ie you can’t allow the forum to re-format it as text, it needs to be an exact character-by-character copy or otherwise I’d be running something different from you which defeats the initial purpose.

So I’d do what I described in the previous post. And I’d likely stick to that explanation if I found the problem, because then you can too. Or if it’s tricky I might have something to add.

I would of course also need to know what your observation of the problem is, or I wouldn’t know I had the same one. So the error message is still relevant.

ok thanks I actually just found my mistake in my code, thanks for telling about reading the code error!

Yeah it’s probably not so much about me knowing anything special as it is … the method of following up on the problem