JavaScript program for array of objects

 var student=[

    {name:"Ravi", age: 21},

    {name:"Ram", age: 13},

    {name:"Gaurav", age: 18},

]

for(var a=0;a<student.length;a++ )

{

    document.write(student[a].name+" "+student[a].age+"<br>")

}


Output





Comments