1. Basic Data type:
String, Decimal, Integer, DateTime, Boolean, and so on.
2. Variables:
are generic type var, can be stored casually other types of values, can be used directly, not defined, but customary definition. Define variables: var A; all variable definitions
are defined with Var, var is a generic mutable type.
3. Type conversion:
It is divided into automatic conversion and casting, which is generally used for casting.
Other types are converted to integers: parseint ();
Other types convert to decimals: parsefloat ();
Determine if it is a valid number type: IsNaN ();
is a number then returns false, not a number to return ture.
Returns False if the number is entered, otherwise returns ture.
4. Operators:
Math Operator: +-*/% + +-;
Relational operators: = =! = >= <= > <;
Logical operator:&& | | ! ;
Other operators: + = = *=/=%=? ;
5. Statement:
It is generally divided into sequential, branching, and cyclic statements.
(1) Branch statement if:
if (judging condition)
{
Statements that meet the criteria to be executed
}
Else
{
Statements executed when a condition is not met
}
(2) Loop for statement:
For ( initial condition; cyclic condition; state change)
{
Loop body
}
(3) Problem type: exhaustive, iterative.
(4) Two keywords: break and continue.
(5) If you want to output the value of a parameter: the value of the output is "+a+" and "+b"
6. Array:
Definition of the array: new Array (); Its length is dynamically variable and can be placed in any type of element.
Assignment of array elements: a[0]=123; A[1]= "Hello";
Array value: A[i];
Array properties: A.length; The number and length of array elements.
Methods: A.sort (); Arrange the array, sort by the first character, A.reverse (); Flipping an array
7. Function:
Four elements of a function: name, input, return value, processing.
Define functions: Function add (formal parameter) {function body}, function named Add, input as parameter, return value can be var type or return value.
function is not invoked when the function is called: Add (Argument).
HTML static Web page--javascript-syntax