0

I have data like this

var data = [{"a": "Aditya", "sub": {"v": "result"}}]

Now what I want is I get data when i pass props as a or sub.v

I know I can access data using data.sub.v but my sub.v is dynamically coming from some service and that is how i want to access the data (it can be any random screen)

Aditya Sethi
  • 10,486
  • 11
  • 26
  • 31
  • you can iterate objects with Object.entries(). – Ehsan Aug 24 '21 at 06:08
  • Yes data[0].sub.v will give it. Question is when I am iterating over data, I need show data in view (The inner content comes from some other service.. so "sub.v" it is coming as string and now over iteration, I want to print "result" as output. – Aditya Sethi Aug 24 '21 at 06:09
  • lodash resolves this problem. Thanks – Aditya Sethi Aug 24 '21 at 06:35

0 Answers0