I read a json file (basically flat table) and dynamically nest the data. I get nested data similar to:
[{key: "AAA", value: 100}, {key: "BBB", value: 200}, {key: "CCC", value: 150}]
Accessing key and/or value by index is no problem, e.g. dat[0].key
, dat[1].value
. But how do I directly access a value by not using (because not knowing) its index. I.e. dat["BBB"].value or dat["AAA"].value
What is the usefulness of key/value pairs, if I still have to access the data via indexes. In my case this would mean, to first somehow determine the index of a specific key and then reference by key.
I am quite sure, this is a very stupid question and I apologize for it, but after several days of searching the net, I still was not able to find an answer.
Thanks an awful lot for any help