Hello, @dannygoler6382924880, and welcome to the forums.
I ran your code, and it seems to return
false as expected. My only suggestion would be to consolidate your
else if into a single conditional. Could you not combine
=== ? Also, consider your concise body arrow function that you used for
generateTarget (really should preface that with
const, but that aside), you could do something similar with your
compareGuesses function. Consider what is returned from the following function:
//we don't actually need to literally return true or false
//we can return the expression
//it will be evaluated, and the result returned:
const lessThanOrEqual = (param1, param2) => param1 <= param2;
console.log(lessThanOrEqual(1, 2)); //true
console.log(lessThanOrEqual(3, 3)); //true
console.log(lessThanOrEqual(5, 2)); //false
Just suggestions. Happy coding!