user1400915 user1400915 - 1 year ago 60
Javascript Question

Accessing dynamic keys from a json object of an array

I need to access keys of a json object which was created dynamically . The array structure is:

self.arrayObj : Array[2]

Key is "Display1" and value is object. This key is dynamic and not fixed . How can I access the Key string from array above.

The output I am expecting as : "Display1" and "Display2"

Answer Source

try this

var keys = [];//final output of all key names


keys now has all the dynamic property names.