Type Object Data type
The object data type in JS data type, consisting of multiple sets of [property name: attribute value] or multiple sets of ' key value pairs '.
Key:value
var obj={name: "Zhang San", age:6};
var personInfo ={
Name = "Zhang San";
age:28;
Height: "180cm";
Weight: "60kg";
}
var obj ={name: "Zhufeng"};//literal creation method
var obj =new Object ();//The way instances are created
Adds a set of property names and property values to an object
Obj.name = "Zhufeng";
obj["name"]= "Zhufeng";
Modify the property value of the original property name, specify that the property name in an object cannot be duplicated, if there is a modification before, it is not added
obj["Name"]= "Zhang San";
Gets the property Name property value, if the property name does not exist, the default return result is undefined
Console.log (obj["name"]);
Console.loh (obj.["name"]);
JS Object Type