Objects in JavaScript have properties and methods. Figure 1 shows a graphical representation of an object. It can also be thought as a function that defines an object type. In order to make this clear, I will use an unortodox approach and define functions before I even introduce variables. As I said before, objects are associative arrays.
Lets see an example of creating a student object.
Marty.gpa is the value 3.95. The last of the basic concepts regarding objects is method. A method is a function included as a property of an object. Lets see this all together in this page . It contains both the example live and the code to create it.