There are two ways to create a object in javascript.
1.
var pig={
weight: "120",
age:1
}
2.
var pig=new Object();
pig.weight="120";
pig.age=1;
3.
var Animal=function(weight,age){
this.weight=weight;
this.age=age;
};
var pig3=new Animal("130",1.5);
There are two ways to access the property of object in javascript.
pig.weight="140";
pig["weight"]="160"