DEV Community

Discussion on: Introduction to OOP in Javascript

Collapse
 
linaran profile image
Deni • Edited

Bad example on inheritance. Inheritance describes an IS-A relationship. Obviously a person is not an organization and such an inheritance doesn't make sense. Also "this" refers to the instance of the class not the class itself. Second description implies that changes on this would influence all instances of some class which is not the case.

Collapse
 
ndiecodes profile image
Ndifreke Friday

thanks for contributing.

Collapse
 
ndiecodes profile image
Ndifreke Friday

you are absolutely right...
why I do agree I did use a bad example while trying to stick to the storyline,
I tried to keep it as simple as possible as I did not expect a newbie to understand instances

Collapse
 
linaran profile image
Deni

Keeping instructions is nice but they need to be precise otherwise a newbie could conclude that "this" is some kind of a static variable and that could make learning difficult down the road.

Just edit the "this" part, overall the article is fine.

Collapse
 
ndiecodes profile image
Ndifreke Friday • Edited

It sure is a bad example none-the-less, I am working on changing it and still keeping it as simple as possible