JS data types are divided into primitive types and object Types
The original type is divided into: null,undefinded, string, number, bool;
Where null and undefinded are values that cannot have a method, and string, number, BOOL can also have its own method.
null,undefinded, string, number, bool are immutable types, and no method can change a primitive value.
object Types are divided into: array,function (), regexp,date
Array,function (), regexp,date can have their own methods.
Array,function (), regexp,date are mutable types.
null and undefinded: Both null and undefinded are worth the vacancy, usually interchangeable
Where typeof null returns the String object, and typeof undefinded returns the string undefinded
Wrapper object : String,number,bool are not objects but can all refer to methods and properties as objects
In string, for example, when a string is called on a property of string, JS converts the string to an object by calling new string (s), and the object inherits the methods and properties of the string, once the reference knot
The newly created object will be destroyed. The temporary object created is called the wrapper object. The modification of a property occurs only on the temporary object, and the temporary object is not saved.
immutable primitive values and mutable Object references : The original value is immutable, no method can change or mutate a primitive value, and the value of the object is mutable, and its value is modifiable.
All methods in the string appear to return a modified string, in effect returning a new string value.
Data type of JS