1. Basic type: string,number,boolean,null,undefined
2. Reference type: Function,array,object------Technical Object Series, typeof () This three type gets the object
Details:
1. All the values of the basic type are stored in the storage area, JS can manipulate the value directly, while all the values of the application type are stored in the heap memory, JS cannot manipulate the value directly, only the Operation property can be changed.
The original data is not affected when the base type is copied, whereas the reference type is copied by copying the pointer, but the pointer is pointing to the same object, so changing one of the two changes;
Schematic diagram is as follows:
Examples are as follows:
var a=1; var b=a;b=2; Cosole.log (a)//1
var a={title: "TestA", Content: "NiceA"}; var b=a;b.title= "Testb"; b.content= "Niceb"; Cosole.log (a.title)// Testb
2. The basic type typeof () can be recognized (except null); application type typeof () all uniformly recognized as Object
For more information on why null conversions are to object, the next chapter will be different when null and undefined
What are the basic types of JS? What are the reference types? (i)