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:
dog.color
dog.weight
dog.breed
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:
dog.fetch()
dog.shake()
dog.sit()
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.