Why is myPerson.age undefined?
function Person() {
var age = 28;
}
var myPerson = new Person();
console.log(myPerson.age);
I have clearly set what the varaible is in the Person function construtor which should be pointed to by the .prototype of myPerson, no?
Try this: