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

What are and what aren't objects in JavaScript?

I am confused as to what are and what aren't objects in JavaScript. If anyone could help me identify them this would be very helpful, thanks.

2 Answers

Hi there Alex, Objects are a bit difficult to define, but here goes nothing! The best way to look at objects is to ask what objects aren't because almost everything is an object in Javascript. To understand why, we can look at the definition of an object in Javascript. An object is merely a collection of properties or methods.

For an example, think of an object as a dog. The dog can be brown or large which are properties, but also do actions such as bark or run which would be considered methods. Let me know if this helped, but as an abstract concept objects can be difficult to understand.

Thanks, you are good at explaining things! From what I have read a variable is an object but its value is not, is that true? I was wondering why JavaScript does not use classes like other object-orientated programming languages, and what is a class I have no idea.