JS data type

Source: Internet
Author: User

  JS data types are mainly divided into basic data types and reference data types

Differences between the base data type and the reference data type:

The base data type is the reference to the reference, and the referencing data type is the address;

The base data type is stored in the stack memory, the stack memory provides the environment for the JS code execution, the reference data type is stored in the memory

Basic data types include:

Array arrays

String strings

Number numbers

Beloon Boolean value

Null

Undefined

Reference data types include:

Object data type

function data type

The object data type is also divided into: array [], object {}, regular regexp, Date object

The object data type is stored in an in-memory step:

1. Opening up a new space address;

2. Place the key values in the object in this memory space;

3. Assign the space address to a variable name, pointing to the current space

The function data type is composed of two parts:

1. Definition phase definition of function 3 steps

1) Open a new space address

2) The function of all the JS code as a string exists in this space

3) Assign the space address to the function name

2. Function call phase call 22 steps

1) A private scope is formed when the function is called

2) Execute the string in the previous heap memory as a JS code

 

JS data type

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.