Basic concepts of JavaScript and basic concepts of javascript
I. Case Sensitive
All variables, function names, and operators in ECMAScript are case sensitive.
For example, the variables test and Test indicate two different variables respectively,
Ii. identifier
The identifier refers to the name of a variable, function, attribute, or function parameter. One or more characters of the identifier in combination according to the following format rules:
The first character must be a letter, underscore (_), or dollar sign ($ );
Other characters can be letters, underscores, dollar signs, or numbers.
ECMAScript identifiers are in the upper and lower case format, that is, the first letter is in lower case, and the first letter of each remaining word is in upper case, for example: firstSecond, myCar, doSomethingImport
3. Notes
ECMAScript uses C-style annotations, including single-line and block-level annotations.
Single line Note: It starts with two slashes, for example:
// Single line comment
A block-level annotation starts with a slash and an asterisk (/*). It ends with an asterisk and a slash (*/), for example:
/*
* This is a multiline
* (Block-level) Annotation
*/
Iv. Statements
The statement in ECMAScript ends with a semicolon. If the semicolon is omitted, it is determined by the parser that the statement ends, for example:
Var sum = a + B // a valid statement even if there is no semicolon ------- not recommended
Var diff = a-B; // valid statement --------- recommended
Although the semicolon at the end is not required, we recommend that you do not omit it at any time.
5. keywords and reserved words
Keywords and reserved words: characters with specific purposes. These keywords can be used to indicate the start or end of a control statement or to execute a specific operation.
Keywords and reserved words: they cannot be used as identifiers or attribute names.
The above is all about the basic concepts of javascript. I hope you will like it.