I’m working on the Number Guesser Project on JavaScript Syntax Part 1.

When running my code. I noticed a few things.

- it’s not comparing the user guess with computer guess
- not calculating the round number
- not accurately calculating/ updating the score when user or computer guesses the number.

I don’t think I set up the function compareGuess properly. My goal here was to compare the difference between what the user guess to what the computer guessed and compare that to the guess value.

Also from my understanding to increment a variable we can say variable += 1 but it appears my functions aren’t calculating these properly. May someone look at my code below to see what I missed?

```
let humanScore = 0;
let computerScore = 0;
let currentRoundNumber = 1;
// Write your code below:
const generateTarget = () => {
return Math.floor(Math.random() * (9-0) + 1)
}
const compareGuess = (userGuess, computerGuess, secret) => {
if (Math.abs(secret - userGuess) <= Math.abs(secret -computerGuess) ) {
return true;
} else {
return false;
}
}
const updateScore = winner => {
if (winner === 'human') {
humanScore += 1;
} else {
compterScore += 1;
}
}
const advanceRound = () => {
currentRoundNumber += 1;
return currentRoundNumber;
}
```