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