Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

JavaScript OOP

So far I have not come across anything in the JS courses on any OOP topic beyond the bare basics and I am concerned about that. It isn't enough to just know how to write and instantiate classes; it's also important to learn inheritance, abstraction, static classes and methods, and public/private visibility. Are there any courses that address these necessary OOP topics for JS here on Treehouse?

1 Answer

Steven Parker
Steven Parker
229,732 Points

The new syntax is handy, but it obscures the fact that "under the hood" JavaScript classes are still based on prototypical concepts and differ from most other languages. One of the differences is that the concept of abstraction does not exist in JavaScript classes and methods. Another is that there is no "private" access modifier.

But while I don't have a ready reference, I do recall that inheritance is covered in the courses.

Thanks for the input. I am coming from PHP, and PHP 7 has pretty robust support for object-orientation including all the common bells and whistles, abstraction, static classes and methods, interfaces and traits, all the access modifiers you need, etc. I'm used to using those features while constructing classes so learning object-orientation in JavaScript feels a bit overly simple. It feels like I'm cheating a bit. I guess I'll have to dive into the docs and do some reading.