Home › Forums › JavaScript › big time problem understanding object › Reply To: big time problem understanding object
October 21, 2013 at 5:38 pm
#153649
Alen
Participant
Objects have properties and methods.
Properties are just values. And methods are just functions that do something with the values.
As you can see in this example:
obj = {
firstName: "Alen",
lastName: "Mofo",
fullName: function(){
alert(this.firstName + " " + this.lastName);
}
}
obj.fullName(); //Prints "Alen Mofo"
firstName
and lastName
is a property. fullName
is a method.