View Single Post
Old 11-05-2010, 03:36 AM   PM User | #3
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,468
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by Old Pedant View Post
I would assume because you want a Closure.
...
If you didn't do that, then Child would simply reference Parent, and all changes in Child would also be changes in Parent.

It's more about inheritance chaining.

It you didn't create a new blank object (using new) each time you ran klass(), you would only inherit from the last passed object's prototype.

this way, you can keep tacking on more property collections.

it's essentially an object property merge, though the props never merge; the just scoot down the chain...
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote