I'm working with a JSON Object in Typescript and I'm trying to split it into parts. Currently, I am only able to access the keys:
Here is my JSON object:
let data = {
"dataTest": "data1,data2,data3",
"insTest": "ins1,ins2,ins3",
"sertest": "ser1,ser2,ser3"
}
This is how I am looping through it:
for (let key of Object.keys(data)) {
console.log(key)
}
The current output is:
1º //dataTest
2º //insTest
3º //serTest
What I actually want to see is:
1º //dataTest: "data1,data2,data3"
2º //insTest: "ins1, ins2, ins3"
3º //serTest: "ser1, ser2, ser3"
Elevation
Is there any way to combine all the values into a single array?
For instance:
data1, data2, data3, ins1, ins2, ins3, ser1, ser2, ser3