{
"Les Miserables":{
"lang": "French",
"type": "Movie"
},
"Some German Book":{
"lang": "German",
"type": "Book"
},
"Gangnam Style":{
"lang": "Korean",
"type": "Song"
},
"Captain America":{
"type": "Comic Book"
},
"Some song":{
"type": "Song"
}
}
I want all the objects that don't have a language to be set to English by default.
How do I do this through JavaScript? I want to update the original JSON object, not create a new one.
Example Output:
{
"Les Miserables":{
"lang": "French",
"type": "Movie"
},
"Some German Book":{
"lang": "German",
"type": "Book"
},
"Gangnam Style":{
"lang": "Korean",
"type": "Song"
},
"Captain America":{
"type": "Comic Book",
"lang": "English"
},
"Some song":{
"type": "Song",
"lang": "English"
}
}
Thanks in advance!