My object structure is as follows:
const Obj =
"Value1": {
"value1value": "1"
},
"Value2": {
"value2value": "2"
},
"Value3": {
"value3value": "3"
},
"BTest": {
"1": "1",
"2": "2"
},
"Value4": {
"value4value": "value4value"
},
"ATest": {
"1": "1",
"2": "2"
},
"Value5": {
"value5value": "value5value",
"value6value": "value6value"
},
"TestA": {
"1": "1",
"2": "2"
};
I am looking to create a new object with the following structure:
cont newObject =
"Value1": {
"value1value": "1"
},
"Value2": {
"value2value": "2"
},
"Value3": {
"value3value": "3"
},
"Value4": {
"value4value": "value4value"
},
"Value5": {
"value5value": "value5value",
"value6value": "value6value"
};
I have attempted to filter out some values using this code snippet:
const newObject = Obj.map(o => {
return { };
});
Unfortunately, my attempts were unsuccessful. Any suggestions on how to achieve this? Thank you in advance.