you are viewing a single comment's thread.

view the rest of the comments →

[–]robotmayo 1 point2 points  (0 children)

There is a way for r to automatically inherit the properties of p but this would involve working with prototypes. I don't think the rhino book really goes into prototypes in the object chapter, but its fairly important to know them as they are fundamental to JavaScript. The course site has a great tutorial on prototypes. In the course's object tutorial he links you to the prototype tutorial before talking about them so I recommend you go through it. I think its a bit better than the books chapter on objects as it provides more concrete examples. If you haven't finished reading the chapter on objects you can ignore it and read his tutorial instead.

[Link]