Characteristics of JS basic type values and reference type values

1. A variable containing a reference type value does not actually contain an object, but a pointer to an object

2. Copy the value of the reference type from one variable to another variable, the copy is actually a pointer, so both variables point to the same object

3. The value of the basic type occupies a fixed size in memory, so it is stored in the stack memory

4. The value of the reference type is an object, so it is stored in the heap memory

5,. Copying a value of a primitive type from one variable to another creates a copy of the value

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325483747&siteId=291194637