Web development design -- js data type, js operator, -- js Operator

Source: Internet
Author: User

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 ".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.