What Are Objects in JavaScript? (Examples Included)

What’s an object in JavaScript?

You can tell whether an object is an object by looking at whether it has properties or methods.

Check out the example below. This is an object.property example:


The word “dog” is the object in all 3 of these examples. As you can see, the word after the first word “dog” is considered the dog’s property.

In the example below, you can see these as object.method structured:


The word “dog” is the object again, and the word after the dot is the method.

You see here that everything before the dot is an object. Anything after the dot is either a property or a method.

Leave a Comment