function Persom(name,city){ this.name = name; this.address.city = city; } Persom.prototype.address = {city:'x'}; var p1 = new Persom('tony','a'); var p2 = new Persom('sam','b'); console.log([p1,p1.address,p1.address.city])