var array = [{id: 1, name: "yyy"},{id: 2, name: "mmmm"}]
for (var i in array){
  console.log(array[i].id)
  console.log(array[i].name)
}