[Vuejs]-Iterating over an object inside an axios.get request in vue js

0👍

you can do that with Object. values()

your code should be like this

...

for (property in Object.values(this.myData)){
  this.form.examiner_id.push(this.myData[property].id);
}

...

or just use forEach()

...

Object.values(this.myData).forEach(item => this.form.examiner_id.push(item.id))

...

Leave a comment