Web development design -- js data type, js operator, -- js Operator
1. js data types include: numeric, Boolean, and string
You can use typeof to view the specific data type.
Example:
<Span style = "font-family: Microsoft YaHei; font-size: 18px; ">
2. js Composite data types: divided into arrays and objects
3. Special Data Types: null, var a = null;
Undefine
4. parseInt (); forcibly converted to an integer;
5. a + = 90 => a = a + 90;
B + = a => B = B +;
B % a modulo, that is, the remainder
What data types are available in JS?
Js is weak-type Prediction
Specific types include:
Number numeric type
String type
Boolean Type true/false
Undefine (undefined type)
Null (null type has only one value, null)
What data types are available in JS?
Js has five data types: Undefined, Null, Boolean, Number, and String.
There is also a complex data type Object, which is essentially composed of a group of unordered name-value pairs.
The Undefined type has only one value, that is, undefined. The variable is declared using var, but not initialized. This variable is of the Undefined type. For example:
Var
I;
Alert (I = undefined); // true
Var I; and var I =
Undefined; the two sentences are equivalent.
Variables that contain Undefined values are different from Undefined variables.
The Null type also has only one value: null. null represents a pointer to a Null object.
Boolean Type: only two literal values: true and false. However, many variables in js can be converted to a Boolean value using the Boolean () function.
Number Type: integer and floating point. NaN: Not
A Number. This value is used to return a value, but it cannot be replaced with a value to prevent errors. Example: 1/0
NaN is returned. Features of NaN: 1. any operation involving NaN will return NaN. 2. NaN is not equal to any value, including its own NaN.
For the NaN feature, JS has built-in isNaN () function to determine whether the value is of the NaN type.
String type: omitted
Typeof OPERATOR: used to deduce the type of a variable. The following string may be returned:
"Undefined"
If this value is undefined or initialized
"Boolean" boolean Value
"String" string
"Number" Value
"Object"
Object
"Function" function
Usage: typeof 95; or typeof (95); "number" is returned ".