ここでは、親クラスのインスタンスを作成し、オブジェクト自体に smile というプロパティを定義しています。コンストラクターのプロトタイプで定義されたプロパティがオブジェクト自体のプロパティではないことはわかっています。しかし、なぜ "smile" プロパティが for in ループ内の hasOwnProperty テストに合格しなかったのでしょうか?
function Parent(){
this.name='parent';
}
Parent.prototype.age='34';
var p=new Parent();
p.smile='nice'; // not an own property ?
console.log(p);
for(var prop in p){
if(Object.hasOwnProperty(prop)){
console.log(prop); // prints only "name"
}
}