Can't access nested object property TS

192 Views Asked by At

I'm trying to access the propertys of this object however my console is returning undefined..?

I've tried every work around, any suggestions?

enter image description here

enter image description here

2

There are 2 best solutions below

2
On BEST ANSWER

You almost certainly want

for (let s of targetItems)

instead of

for (let s in targetItems)
1
On

JSON.parse(targetItems[s]).CategoryId