I have the following javascript object
const items = {
"item 1":{name:'test',vals:[{name:'first',....}]},
"item 2":{name:'test3',vals:[{name:'second', ....}]}
//other keys
}
The object keys are dynamic and not just "item 1" and 2 and they keep on changing. I want to access the name property of each object. SO i have done the following by am stuck
Object.keys(items).forEach(key=>{
let keyitem = items.key //am stuck on how to pass the key
})
How do i proceed to the dynamic key as the items.key
is undefined as there is no such key in the items object.How do i proceed.