1. The base type value occupies a fixed amount of space in memory and is therefore stored in the stack memory for example:
var a=1; var b= "Hello World";
2. Assigning a value of the base type from one variable to another creates a copy of the value, for example:
var b= "JavaScript"; var c=b;
3. The value of a reference type is an object, Save in heap memory 4. A variable that contains a reference type value does not actually contain the object itself, but rather a pointer to the object 5. The value of the reference type is assigned to another variable from one variable, so that the two variables ultimately point to the same object 6. Determine which base type a value is that can use the TypeOf operator, and Determine which reference type a value is available using the instanceof operator for example:
var arr=["abc", "BCD", "XYZ"];
var arr2=arr;//Here the ARR2 actually replicates only the pointers to Arr, which all point to the same array object
Console.log (typeof arr); Object
Console.log (arr2 instanceof Object);
Console.log (arr2 instanceof Array);
All of these results are true because the array is an instance of the JavaScript built-in object array, and all objects are subordinate to the object
JavaScript learning summarizes the types of data in 1--javascript