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

Gabor Galantai
PLUS
Gabor Galantai
Courses Plus Student 17,247 Points

Object-Oriented JavaScript without creating classes

I just finished the OOP course on JavaScript and I wonder if there is a reason why there wasn't a single word about creating and using classes in it. In every object-oriented language I've seen so far they use classes, and I know that JS has this too, so why is there nothing about it? I've gone through the basic JS track and I'm half way in the full stack JS track and nothing... Why?

1 Answer

andren
andren
28,558 Points

The reason is that while it's technically true that JavaScript supports classes it did not add support for them until ES6 / ES2015. Which is the most recent revision of the JavaScript language. Since ES6 is still relatively new many JavaScript courses on the web (on Treehouse and elsewhere) have not yet been updated to cover any of the concepts introduced in it.

Treehouse did update and add some new courses a couple of months ago which is why some ES6 concepts like let and const and arrow functions have been covered. But most JavaScript courses on Treehouse was recorded quite a while ago and do not include any ES6 syntax at all.

The closet thing JavaScript had to classes before ES6 was the prototype and the prototype inheritance system, which was covered in the OOP course.