/**
* Simple example of a Prototype pattern
*/
var personProto = function(){}
personProto.prototype.age = 0;
personProto.prototype.name = ""
personProto.prototype.city = "";
personProto.prototype.log = function(){
console.log(this.name +" "+this.age+" "+ this.city);
};
// Note you must use the new keyword it initialize the object with this pattern
var p1 = new personProto();
p1.age = "25";
//p1.name="paul"; // commented out to show how hasOwnProperty works in this example
p1.city="Orlando";
p1.log();
// does the property "name" exist in object p1
console.log ("name" in p1);
// does the function "log" exist in object p1
console.log ("log" in p1);