Number Guesser Challenge Project (JavaScript)

This was my solution. I think the compareGuesses() function is actually easier this way than in the solution, but I’d like to know what you think about it, maybe it works just by a stroke of luck!

Hello, @lpianta2321219555, and welcome to the forums. Your compareGuesses() function is totally fine, but you could make it more concise if you wanted to. Consider the following example, and then think about how you could apply the same technique to your function.

const returnTrueOrFalse = (value1, value2) => value1 >= value2; //what is returned?

//what will be printed to the console?
console.log(returnTrueOrFalse(5, 4)); 
console.log(returnTrueOrFalse(4, 5));