I have received data from an external source:
[{
"mode": "CURR",
"isin": "PLESLTN00010",
"from": 451183,
"to": null,
"data": [{
"t": 1624265539,
"p": 5,
"o": 5,
"c": 5,
"l": 5,
"h": 5,
"v": 2
}]
}]
My goal is to extract the value of "c" within the data array.
This is what I attempted:
const arrNcnct = ncdata.map(a => a.data).flat();
Although it retrieves the entire data object, I'm struggling to specifically get the value of "c".
const c = arrNcnct.map(el => ({ current: el.c}));
console.log(Object.values(c));
The output shows:
[{"current": 5}]
Seems like I am missing something...