1. Syntax
JavaScript syntax is similar to the Java language, with each statement being; End, statement block with {...}. However, JavaScript does not enforce the requirement to add at the end of each statement; , the engine responsible for executing JavaScript code in the browser automatically complements the end of each statement.
(a line typically writes a statement and does not recommend writing multiple statements on one line).
2. Notes
Comments are for developers to see, and the JavaScript engine is automatically ignored.
(1). Characters that start with//until the end of the line are treated as line comments. This is a line of note alert ("Hello World"); This is also a comment
(2). Another block comment is to wrap a multiline character with/*...*/and treat a chunk as a comment. /* Starting from here is the block comment is still the comment comment end */
3. Identifiers
Identifiers are names that are assigned to variables, functions, and objects.
The letter that makes up the identifier is a specification of the naming rules for identifiers in the JavaScript language:
1. Case-sensitive
2. The first character of an identifier can be an underscore _, a dollar symbol, or a letter, but not a number; Other characters can be an underscore _, dollar symbol $, letter or number
3. Identifiers cannot use keywords and reserved words, etc.
JS Basic syntax