I have a following array of Object, I wanted to match the Object Keys from locales array and match with the value property in the object.
Output: If the Object key from locales matches the value property, then i want to display the text in Object values from locales.
What i have in an array is:
[{
value: 'dz'
locales: [
{ar-dz: "Hello World"},
{ar-dk: "Hello World"}
]
}]
I am stuck in a logic beyond this point.
for(var i = 0; i < data.locales.length; i++) {
var localearray = Object.keys(data.locales[i]));
var locales = localearray[i].split('-');
console.log(locales);
}