Back to Content

Syntax error

files/en-us/glossary/syntax_error/index.md

latest547 B
Original Source

An {{Glossary("exception")}} caused by the incorrect use of a pre-defined {{Glossary("syntax")}}. Syntax errors are detected while compiling or parsing source code.

For example, if you leave off a closing brace (}) when defining a {{Glossary("JavaScript")}} function, you trigger a syntax error. Browser development tools display {{Glossary("JavaScript")}} and {{Glossary("CSS")}} syntax errors in the console.

See also

  • Syntax error on Wikipedia
  • {{jsxref("SyntaxError")}} JavaScript object