i'm parsing/mapping 2 differents types of data/objects inside i.values:
i can see in console:
(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/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}
this is my code to parse/map:
this.cstInputs.map(i => {
i.values = i.values.map((k, v) => {
return {
value: v,
label: k
}
});
}
the code are failing in the last object: no: "I'm not"...
Uncaught (in promise) TypeError: i.values.map is not a function...
how can I analyze these different types of data or differentiate them to get a key pair value with other method like map
?
thank you