Skip to content
Advertisement

Sytax error – Even though I have already found the bug but the error still there

I am creating an app that finds the difference and checks for spelling. I am getting the same error after adding the missing curly bracket for the ‘for’ loop. I am not sure why it is repeating and the error is not going away.

Uncaught SyntaxError: Unexpected end of input

Please let me know if I am doing something wrong.

Thank you!`

JavaScript

Advertisement

Answer

There are several issues with your code:

  1. Your else condition has no closing curly bracket (‘}’)
  2. It is missing a closing parenthesis and curly bracket for the event listener

Corrected code:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement