LOST in CODE

JSON Attributes

I’ve recently been trying to parse content out of JSON objects where I can’t know for sure what the actual attributes are called, after quite a lot of searching I finally stumbled over this:

yourJSONobject._attributes

Which is an array of all the attribute names so you can then do things like:

yourJSONobject[yourJSONobject._attributes[0]]