I have an array with multiple objects.So how to make a new object by splitting the objects.
Here is how i am doing manually. How can I achieve it dynamically.
var a ='["{\\"Transfer_Notes__c\\":{\\"filterType\\":\\"text\\",\\"type\\":\\"contains\\",\\"filter\\":\\"abc\\"}}","{\\"IQ_Score__c\\":{\\"filterType\\":\\"number\\",\\"type\\":\\"equals\\",\\"filter\\":null,\\"filterTo\\":null}}"]';
var c = {};
c= JSON.parse(a);
const obj = Object.assign({}, JSON.parse(c[0]),JSON.parse(c[1]));
console.log(obj)
I tried several ways. Please help!
(for const item of c) { ... // Your code here}JSON.parse()What a I missing, how does your comment have two upvotes? Did you run the code?