I passed the following object:
var myVar = { typeA: { option1: "one", option2: "two" } }
I want to pull the typeA key from the above structure.
This value can change every time, so the next time it can be typeB .
So, I would like to know if there is a way to do something like the following pseudocode:
var theTypeIs = myVar.key();
That way, when I can pass this object, and I can pull out the first value of the object, in this case typeA , and then based on this I can do different things with option1 and option2 .
javascript
user3447415 Mar 21 '14 at 17:06 2014-03-21 17:06
source share