Number guesser

hi, can someone help me? i don’t know why my code is not working. ?

const generateTarget = () => {
  return = Math.floor(Math.random() * 10) 
}

const compareGuesses = (user, computer, target) => {
  if (user === computer) {
    return true;
    } else if (Math.abs(user - target) > Math.abs(computer - target)) {
    return false; 
        } else {
    return true;
      }  
  }

const updateScore = whoWon => {
  if (whoWon === 'human'){
    humanScore += 1;
  } else if (whoWon === 'computer'){
    computerScore +=1;
  }
}

const advanceRound = () => currentRoundNumber += 1;

the syntax error you get is pretty helpful, looking at this line:

return = Math.floor(Math.random() * 10) 

you can’t assign (=) to a return keyword.

1 Like

Ah, thank you! I appreciate your response!! My code works once this is fixed!