Expected ';'

You attempted to place more than one statement on a line, but did not separate them with semicolons. Semicolons are used to terminate statements. Although you can place several statements on a single line, each one must be delimited from the next with a semicolon.

To correct this error

  • Mark the end of each statement with a semicolon.

  • Make sure your function calls use parentheses properly.

  • Make sure you did not forget the semicolons inside the header of a for loop.

See Also

Writing JavaScript Code