Naming rules for JavaScript identifiers: You must start with a letter or underscore, the middle can be a number, a letter, or an underscore; A variable name cannot contain a space, a plus, a minus sign, or a keyword in javascript; a JavaScript variable name is strictly case-sensitive
| Abstract |
Continue |
Finally |
instanceof |
Private |
This |
Boolean |
Default |
| Float |
Int |
Public |
Throw |
Break |
Do |
For |
Interface |
| Return |
typeof |
Byte |
Double |
function |
Long |
Short |
True |
| Case |
Else |
Goto |
Native |
Static |
Var |
Catch |
Extends |
| Implements |
New |
Super |
void |
Char |
False |
Import |
Null |
| Switch |
While |
Class |
Final |
Inch |
Package |
Synchronized |
With |
JavaScript variables are declared by the keyword VAR, and the syntax is:var variable The following rules for declaring variables: You can declare multiple variables at the same time using a keyword var; you can assign a value to a variable at the same time that it is declared, that is, initialization If a variable is declared only and is not assigned a value, its value defaults to undefined;
JavaScript Learning Notes (ii) JavaScript basics