JavaScript objects are data that owns properties and methods.
In JavaScript, almost all things are objects.
An object is also a variable, but an object can have more than one value.
For example:
var person = {firstName: "John", LastName: "Doe", Age:50, Eyecolor: "Blue"};
Object Properties
It can be said that a JavaScript object is a container for a variable, but a JavaScript object is generally considered a container for key-value pairs. The form is Name:value (the key is separated from the value with a colon). Key-value pairs are called object properties in the object.
Accessing Object Properties
Object properties can be accessed in two ways.
person.nameperson["name"]
Object methods
The method of the object defines a function and stores it as an object's property.
The object method is called (as a function) by adding ().
The instance accesses the FullName () method of the Person object:
1 name = Person.fullname ();
Accessing Object methods
You can create method properties in objects by using the following methods
1 methodName:function() {// actual code}
Object methods can be accessed through the following syntax
1 objectname.methodname ();
(1) JavaScript objects