A script is composed of an unordered collection of the following kinds of entities:
Whitespace is used to improve the readability of the script and to separate tokens from one another, where they could be misinterpreted if they were concatenated together.
Line terminators are used to improve the readability of the source text and to separate tokens. However, unlike whitespace, line terminators can affect the behavior of the script when placed in certain places. In general, a line terminator can occur between any two tokens but cannot appear in a token or inside a string literal. Line terminators in string literals must be escaped if they are required as part of the string. Line terminators also affect the automatic semicolon insertion process.
Comments can be contained completely on a single line or can span multiple lines.
A single line comment must finish at the end of the line and cannot contain a line terminator. You can place multiple single line comments one after another if required, each one separated by a line terminator.
Multiple line comments are replaced by a single line terminator during parsing. It doesn't matter how many line terminators they actually contain. This means that a multiple line comment behaves syntactically as if it were a line terminator.
Tokens are the actual components that your executable script is built from. They may be reserved words, identifiers, punctuator symbols or literals.
ECMA 262 edition 2 - section - 7
ECMA 262 edition 3 - section - 7