Objects are a data type that let us store a collection of properties and methods.
var objectName = {
propertyName: propertyValue,
propertyName: propertyValue,
...
};
var aboutMe = {
hometown: "Pasadena, CA",
hair: "brown"
};
var lizzieTheCat = {
age: 18,
furColor: "grey",
likes: ["catnip", "milk"],
birthday: {"month": 7, "day": 17, year: 1994}
};
Javascript has a more complex data type called an 'object'. Objects allow us to describe an entity that has a complex structure, and more closely resembles something that exist in the real world.
Arrays and functions are both special types of objects in Javascript. We can also define our own objects to represent complex data structures.
Just like objects in the real world, Javascript objects have attributes - called 'properties', and things they can do - called 'methods'. For example, we can create an object that represents a dog in Javascript. It could have properties like 'colour' and 'breed', and methods like 'bark' and 'chaseCat'.