In javascript object is an entity which can store related data (properties) and behaviors (methods).

The following code creates a doctor object with 3 properties.
var doctor={name:"Dr.Rajeev", age:36, qualification:"MBBS"} ;
We can access data members associated with an object using objectname [dot] property name. Hence the following code displays doctor name, age and qualification's respectively.
In javascript objects are usually defined by using curly brackets. Javascript object properties are usually separated by using semi colons. In javascript properties and values are separated by using colon [:] symbol. If a function is associated with an object , the function can be called by using objectname [dot] function-name as shown below.
    <title>Javascript objects</title>
    <script language="javascript" type="text/javascript">
     var oDoctor= {name:"manasvi",age:5,qualification:"MS",
     getMedicine:function(disease) { if(disease=="fever") return "paracetmol" ; else return "dolo"; }
     function fnTest() {
       //the following code will call getMedicine function.
     var medcineName=oDoctor.getMedicine("cold");
    <input type="submit" value="submit" onclick="fnTest()"/>