This is what my object looks like (I don't have a lot of control over how it's formatted):
[{
"Country": "Spain",
"info info1": 0.329235716,
"info info2": 0.447683684,
"info info3": 0.447683747
}, {
"Country": "Chile",
"info info1": 1.302673893,
"info info2": 1.357820775,
"info info3": 1.35626442
}, {
"Country": "USA",
"info info1": 7.78805016,
"info info2": 26.59681951,
"info info3": 9.200900779
}]
There will be various countries I need to keep the data for, but change the country name. There will also be countries I need to omit altogether.
This is one of those times that I've bitten off more than I can chew all at once, and the work I've done so far is just tire spinning.
$.each(output_json, function() {
$.each(this, function(k, v) {
console.log(k);
});
});
I was attempting to loop through it in this manner, but I'm just getting key/value pairs and I'm not sure how to remove an entire entry based on what I find inside.
Does anyone know of a function/library/jQuery plugin that will quickly allow me to manipulate the object in the manner I've described?
kkey value is simply the numeric index of the particular sub-object you're currently at in the .each() loop. When you find the element you want nuked, delete it, then return false from the closure to abort the .each loop.