Hello there,

I am stuck in task number 4. The task says following:

Create a

`compareGuesses()`

function. This function will be called each round to determine which guess is closest to the target number.This function:

- Has three parameters representing the user (human) guess, a computer guess, and the secret target number to be guessed.
- Determines which player (human or computer) wins based on which guess is closest to the target. If both players are tied, the human user should win.
- Return
`true`

if the human player wins, and`false`

if the computer player wins.

I have already created below function as per the above mentioned task and when I wanted to test it out, I called it with example values and it looks like my function is wrong, I guess, I made an error in the logic, can someone kindly assist me please? So I can get the correct code and move on to the next task in the project.

```
const compareGuesses = (humanGuess, computerGuess, targetNumber)=>{
if (Math.abs(humanGuess - computerGuess) === Math.abs(computerGuess - humanGuess)){
return true;
}else if (Math.abs(humanGuess - targetNumber) > Math.abs(computerGuess - targetNumber)){
return true;
}else{
return false
};
}
compareGuesses(5,8,5);
```