I would like to use Jquery to return the keys: Country, Country_Code and Continent and only have them showing up once.
var countryList = [
{"Country":"Canada","Country_Code":"CAN", "Continent":"North America"},
{"Country":"USA","Country_Code":"USA","Continent":"North America"},
{"Country":"Brazil","Country_Code":"BRA","Continent":"South America"},
{"Country":"France","Country_Code":"FRA","Continent":"Europe"},
{"Country":"Spain","Country_Code":"SPA","Continent":"Europe"}
];
How would I get return the actual key name without looping through the 5 objects Canada, USA, Brazil, France, and Spain in the countryList.
This is my code in jquery:
$.each(countryList, function() {
$.each(this, function(k, v) {
console.log(k);
});
});
Thanks Cheers