Number guesser / syntax error

not sure why I am returning a syntax error here it happens every so often not sure if I just didn’t memorize something right or what.
https://gist.github.com/1904e26c27c0cb17d4bae28841a8c9f0

also first post so im not sure how to make my code appear in post sorry

Yea it’s 2 or 3 syntax errors and one mispelling.

My suggestion is to look at the line where it says the error appear and check everything syntax-related (commas, semicolons, parenthesis, etc) on that line and the line above it.

So for example, are you sure you have all your parenthesis in place?

Great first post btw! It also helps to paste the error:

test.js:10
if (Math.abs((humanGuess - targetGuess) < (computerGuess - targetGuess)) {
^
SyntaxError: Unexpected token ‘{’

and you’ve already done great by linking your code.

Another thing you can do is give your opinion as to what you think the problem might be and what you’ve tried doing to fix it.

1 Like