Object: Memory space in memory where multiple data or methods are saved, representing the result of saving multiple properties and methods in the program.
There are three ways of creating objects
Method an object Direct quantity (an object)
// Create Object var person="name": "Xiaoming""age": +, infor:function() { Console.log ("I ' M" +this.name+ "I ' M" +this. Age ); }
Method Two instantiating an object (an object)
// Create Object var person=new objcet ();
Person.name= "Xiao Ming";
person.age=14;
Method three instantiate an object through a constructor, you can create multiple objects of the same structure
this. name=name ; this. age= age; this. infor=function() { console.log (the. name+ this . age);} } var p1=New person ("xiaoming", +); var p2=New person ("Xiao Hua");p 1.infor ();p 2.infor ();
Finally, the object has a very important built-in property __proto__ the prototype to the constructor
Objects in JavaScript