Basic concepts of javascrpit:
1) Case sensitivity is the same as that of Java. variables, functions, operators, and other things in JS are case-sensitive. For example, variables mytag and mytag are two different variables.
2) weak type changes. Therefore, the weak type variable indicates that the variable in JS does not have a specific type, unlike C. Only "Var" is used for variable definition and can be initialized to any value, so that the type of data stored in the variable can be changed randomly, which is not recommended;
For example, VAR age = 25;
VaR myname = "zhangsan ";
3) The semicolons at the end of each line are optional.
example:
var A = 2
var B = 3;
Note: If there is no semicolon, by default, JS considers the end of the Code line as the end of the statement.
4) brackets are used for code blocks, A code block indicates a series of code executed in sequence. Are enclosed in curly braces of JS. "{}"
example:
If (myname = "AA ")
{< br> var age = 67;
alert (AGE);
}< br> 5) method of annotation and C, C #, same as Java
// single line comment
/*
multi-line comment
*/
for HTML pages, javaScript code is contained in the middle of the MARK. You can also use the src attribute in