Home > Web Front-end > JS Tutorial > body text

Summary of JavaScript data types

巴扎黑
Release: 2017-08-13 14:45:00
Original
1106 people have browsed it

The editor below will bring you an old-fashioned talk about js data types. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

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


Basic data The difference between types and reference data types:

Basic data types are references to values, while reference data types are references to addresses;

Basic data types are stored in stack memory , the stack memory provides an environment for JS code execution, and the reference data types are stored in the memory

The basic data types include:

Array array

string string

number number

beloon Boolean value

null

undefined

##Reference data types include:

Object data type

Function data type

Object data type is divided into: array[], object{}, regular RegExp, date object

The steps for storing object data types in memory:

1. Open up a new space address;

2. Put the keys in the object Values ​​are stored in this memory space;

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

The function data type consists of two parts:

1. Function definition phase Definition 3 steps

1) Open up a new space address

2) Put all the JS code in the function as The string is stored in this space

3) Assign the space address to the function name

2. The function call phase calls 2 steps

1) When the function is called A private scope will be formed

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

The above is the detailed content of Summary of JavaScript data types. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template