Resolved my issue
var allKeys = ["key","en","ar"];
for(var i=0;i<allKeys.length;i++) {
for(j=0;j<jsonText.Sheet1.length;j++) {
console.log(allKeys[i] + ' - ' + jsonText.Sheet1[j][allKeys[i]]);
}
}
Appreciation to @Aniket Sinha
How can I parse and organize incorrect JSON data?
The invalid JSON data provided;
{
"Sheet1": [
{
"key": "title",
"en": "title",
"ar": "arabic_title", //comma at the end here
},
{
"key": "content",
"en": "content",
"ar": "arabic_content", //comma at the end here
}
]
}
Desired output:
key - title
key - content
en - title
en - content
ar - arabic_title
ar - arabic_content