3

i know how to inherit in c++, vb(6-shame on me), and php

I saw many examples and tutorials about it regarding javascript. but no simple explanation about it. What i need is an starting point that will leave me with the need to learn "just" the syntax and usage.

hope i am clear enough. thanks

yossi
  • 3,090
  • 7
  • 45
  • 65
  • 1
    Well, what have you read and what didn't you understand? You will probably get links to sources you already read... – Felix Kling Aug 04 '10 at 15:26
  • There are many ways to implement inheritance in JavaScript, check [this question](http://stackoverflow.com/questions/2107556/how-to-inherit-from-a-class-in-javascript/2107586#2107586), I give a small overview of the most popular techniques. – Christian C. Salvadó Aug 04 '10 at 16:53
  • thank you felix, you are correct, i've read enough :) the crockford's text was very helpful,still have to read some more -but i am okay now. thanks CMS, checking it out now,seems promising :) – yossi Aug 04 '10 at 22:00

2 Answers2

3

http://www.crockford.com/javascript/inheritance.html

check that out. Note prototypal inheritance is nothing like classical inheritance.

hvgotcodes
  • 118,147
  • 33
  • 203
  • 236
2

Crockford is the king - so I highly recommend reading the link provided by @hvgotcodes

Since you asked for practical implementation, I wrote up an example a while back showcasing the practical application of the OO paradigm in JS -

http://tikkunology.blogspot.com/2010/02/practical-object-oriented-javascript.html

Hopefully it'll help

Nirvana Tikku
  • 4,105
  • 1
  • 20
  • 28