JavaScript objects are containers for named values called properties or methods. A method is actually a function definition stored as a property value.

var person = {
    firstName: "John",
    lastName: "Doe",
    age: 50,
    eyeColor: "blue",
    fullName: function() {
      return this.firstName + " " + this.lastName;
    }
};

You can access object properties in two ways:

objectName.propertyName
objectName["propertyName"]

Yonggoo Noh

I am interested in Computer science and Mathematics.