Organize JavaScript basics

Source: Internet
Author: User

Primitive type value (Primitive values)

The following are all primitive type values (abbreviations: original values):

    • Boolean type: True,false
    • Number type: 1736,1.351
    • String type: ' abc ','ABC '
    • Two "no Value (non-values)": Undefined,null
Object (Objects)

All values other than the original value (non-primitive) are objects. Some of the most common types of objects are:

Simple objects (types are object) can be created by object literals:

{    ' Jane ',    ' Doe '}

The above object has two properties: the value of the FirstName property is "Jane", and the value of the LastName property is "Doe".

An array (type is an array) can be created by an array literal:

[' Apple ', ' banana ', ' cherry ']

The above array has three elements that can be accessed through a numeric index. For example, the index of "Apple" is 0.

A regular Expression object (type RegExp) can be created with regular expression literals.

/^a+b+$/

BOOL (booleans)

The primitive values of the Boolean type include True and false. The following operator produces a Boolean value:

    • Binary logical operator:&& (with), | | Or
    • Prefix logical operator:! (non)
    • Equivalent operator: = = = = = =!== = =
    • comparison operator (string or number):> >= < <=
Undefined and null (undefined and null)

Note: http://www.cnblogs.com/yanhaijing/p/3685304.html#sect_conventions

Organize JavaScript basics

Related Article

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.