I have a JSON string from an API response which looks like this:
{ "legend_size": 1,
"data": {
"series": [ "2013-05-01", "2013-05-02" ],
"values": {
"Sign Up": {
"2013-05-05": 10,
"2013-05-04": 10
}
}
}
}
I'd like to sum the values in the "Sign Up" Object (10 + 10). The challenge I am having is that the key's are unique and most of the posts demonstrating how to do something like this show examples where it is just an array of values or the keys are consistent (ie - every key is "value").
Should I be attempting to use the Series array to loop through the Sign Up Object?
JSON.parse(string);to put it in to a JS Object. Not sure if that is necessary.