this is my code for the number guesser project. sth seems off as the next round button and the score counter dont work properly. you can find the project here https://www.codecademy.com/projects/practice/number-guesser-independent-practice. please help
let humanScore = 0;
let computerScore = 0;
let currentRoundNumber = 1;
// Write your code below:
const generateTarget = () => {
return Math.floor(Math.random() * 9);
};
const compareGuesses = (hGuess, cGuess, tNumber) => {
if (Math.abs(hGuess - tNumber) <= Maths.abs(cGuess - tNumber)) {
return true;
} else if (Math.abs(hGuess - tNumber) > Maths.abs(cGuess - tNumber)) {
return false;
}
};
const updateScore = (winner) => {
if (winner == "human") {
return humanScore++;
}
if (winner == "computer") {
return computerScore++;
}
};
const advanceRound = () => {
return currentRoundNumber++;
};