/* Add attributes and methods to an empty object after instantiation */OBJ = {}; obj. name = "zhangsan"; obj. age = 33; obj. showinfo = function () {alert (obj. name + "," + obj. age);} obj. showinfo (); // Zhang San, 33/* use a function to create and return the object */function getobj (name, age) {return {Name: name, age: age, showinfo: function () {alert (this. name + "," + this. age) ;}} getobj ("James", 33 ). showinfo (); // Zhang San, 33/* simulation class */function myclass (name, age) {This. name = Name; // attribute this. age = age; // attribute this. showname = function () {alert (this. name) ;}; // method} obj1 = new myclass ("Zhang San", 33); // instantiate obj1.showname (); // Zhang San // Add attributes and Methods myclass. prototype. classname = "myclass"; myclass. prototype. showinfo = function () {alert (this. classname + "," + this. name + "," + this. age);} obj1.showinfo (); // myclass, Zhang San, 33obj2 = new myclass ("Li Si", 44); // instantiate obj2.showinfo (); // myclass, Li Si, 44