When parsing and mapping two different types of data or objects within i.values, the console output shows:
(3) [1, 2, 3,__ob__: Observer]
0:1
1:2
2:3
length:3
__ob__: Observer {value: Array(3), dep: Dep, vmCount: 0}
__proto__: Array
The next type of data or object is:
{__ob__: Observer}
no: "I'm not"
not_sure: "I'm not sure"
yes: "I'm sure"
__ob__: Observer {value: {...}, dep: Dep, vmCount: 0}
My code for parsing and mapping looks like this:
this.cstInputs.map(i => {
i.values = i.values.map((k, v) => {
return {
value: v,
label: k
}
});
}
The issue arises with the last object: no: "I'm not"...
Uncaught (in promise) TypeError: i.values.map is not a function...
Is there a way to analyze these different data types or differentiate them to extract key-value pairs using a method other than map
?
Thank you.