Can someone please explain why in the following code we get output: "wwww":
this.kuki="wwww";
function Ninja()
{
}
Ninja.prototype ={boogie:{kuki:"111",woogie:this.kuki} };
var k= new Ninja();
alert(k.boogie.woogie);//wwww
whereas in the following code we get an output of undefined:
this.kuki="wwww";
function Ninja()
{
this.boogie={kuki:"111",woogie:this.kuki} ;
}
var k= new Ninja();
alert(k.boogie.woogie);//undefined
?