I have an array of objects with dynamic country keys. I need to get the country key and put it into a new array. The array can contain more dynamic keys with the name of the countries.
const arr1 = [
{
id: 1,
label: 'CA',
value: 9,
Canada: 9,
},
{
id: 2,
label: 'US',
value: 7,
'United States': 7,
},
{
id: 3,
label: 'AU',
value: 5,
Australia: 5,
},
];
const result = ['Canada', United States', 'Australia']