i have not that much expierience with javascript. in my project I want to iterate over an array, unfortunately it doesn't work and I can't find a solution. in my array are 3 objects see screenshots from console log. after the iteration I want to output the objects individually using a console log. but this does not work.
here the picture of the console:
here is my code:
var url;
console.log("All Configs -> ", this.segmenteConfig);
this.segmenteConfig.forEach(segmenteConfig => {
console.log("used config -> ", segmenteConfig)
if (segmenteConfig.type === type) {
url = segmenteConfig.url;
console.log("used configs url -> ", url);
}
})
In you case this.segmenteConfig
is not an array. As shown in the first console statement it is a [__ob__: Observer]
. First convert it to normal JS object/array.
Refrence: Vue JS returns [__ob__: Observer] data instead of my array of objects
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.