Lets say I have an array object like this:
var a = {
data: [
'name': 'somename',
]
}
Here I want to check if my array has list. If it is then I want convert the list into json and return new value.
I can do this in python like:
assets = {}
for k,v in data.items():
if type(v) is list:
assets[k] = json.dumps(v)
else:
assets[k] = v
How can I achieve this in javascript ??