Prototypes and Inheritance in JavaScript

Forget everything you know about object-oriented programming. Instead, I want you to think about race cars. Yes – race cars.

That's the intro for my latest article @ Script Junkie - Prototypes and Inheritance in JavaScript. I hope you enjoy reading it.

 

Print | posted @ Thursday, July 22, 2010 9:12 PM

Comments on this entry:

Gravatar # re: Prototypes and Inheritance in JavaScript
by Ken at 7/23/2010 2:33 AM

Thanks!
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Juergen Riemer at 7/23/2010 6:43 AM

Thanks for the article. Only problem: you can't print the article :(
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Jason Meckley at 7/23/2010 9:06 AM

Scott, nice article. javascript has always been an enigma to me. jquery made javascript easier, but it was still a black box operation. your article on prototypes helps me understand what the core javascript language is capable of. which demystifies some of javascripts "magic".
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Erik at 7/23/2010 9:20 AM

Great article! I've read others on this topic that haven't really helped me to understand the subject as well as yours did. Thanks! =)
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Christof Jans at 7/23/2010 11:26 AM

So __proto__ and prototype are not the same? That right there clarified a lot for me. Thx for the article.
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Doeke Zanstra at 7/24/2010 7:51 AM

Nice article! But can you also explain why prototype and __proto__ can't be the same? The way you explain it makes it simple to understand, but why on earth do you both know prototype AND _proto__???
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by scott at 7/24/2010 12:44 PM

@Christof: Yes. To be honest, I didn't understand this fully for a number of years.

@Doeke: How did I know about __proto__ and prototype? By reading the spec again :) www.ecma-international.org/.../Ecma-262.htm
  
Gravatar # re: Prototypes and Inheritance in JavaScript
by Evan at 8/5/2010 9:19 PM

Hey Scott,

Nice article. Thought you might be interested in bashing my POC for prototypal inheritance in C#:

www.weirdlover.com/...

Cheers,
Evan
  
Comments have been closed on this topic.
Scott Allen
Posts - 869
Comments - 4493
Stories - 14