Prototypal inheritance in JavaScript

rohit jangid rohit.nsit08 at gmail.com
Tue Jun 14 12:57:24 UTC 2011


thanks lucian.

My view on inheritance was that.
1) first an empty object is created and it prototype points to
constructor's prototype .
2) this object is passed into the constructor function where it can be
refrenced by "this"
3) this is returned when we use new operator with constructor funtion .

but as I tried to print what is stored in rj and rj.prototype , rj was
empty object and rj.prototype was undefined. So how is it able to
access that test() property .

the problem came when , an object was using different properties and I
couldn't figured out how it was accessing them and what are the other
available properties.


More information about the parrot-dev mailing list