Syntax

Syntax is like the language's grammer. You have to put the symbols and words in the correct order to get the script to work properly. JavaScript syntax includes symbols such as:

parentheses ()
curly brackets/braces {}
brackets []
comma ,
period .
colon :
semicolon ;
single quotes ' '
double quotes " "

Also keywords and variables (future section), etc.

Don't worry, this image is here only for an example of syntax. You don't have to understand everything right now, we're going to take it a step at a time.

Syntax is used to define and interpret the different aspects of the language. An interpreter (built into browsers) will interpret the syntax and convert the information into computer instructions.

In the above image, the lines with double forward slashes "//" are comments. We'll talk about those in the next section.

Next