The original type exists in the heap, the reference type exists in the stack, and the reference type is a pointer to the memory of the object.
There are 5 primitive types :Undefined, Null, String, Boolean,number.
JavaScript provides a typeof method to determine the value type, and the result of the original type is undefined,object, String, Boolean, number (typeof null The result is object, which is a historical error but is used as a habit, and the result of the reference type is object.
reference types are generally understood as classes, and object can be said to be the base class for all classes. The class is not explicitly present in JavaScript and is called an object. Other such as a String object, a Boolean object, a number object.
Object objects
1.constructor Constructors
var New Object (); alert (obj.constructor); Result: function Object () { [native code]}
2.Prototype
1.hasOwnProperty (property) Whether there is an attribute
2.IsPrototypeOf (object) is another object prototype
Whether the 3.PropertyIsEnumerable property can be for...in enumerated
4.ToString () returns the string representation of an object
5.valueOf () returns the original value that best fits the object. Most of the time, the same as the ToString () result
The original type and reference type of JavaScript