I am working on react native project.
In that, I am getting multiple data from api like following.
{
Value: "895"
Return: "2"
Return1: "0.20"
Return3: "0.40"
Return5: "0.60"
Return10: "0.50"
StartDate: "2019-06-13"
}, {
Value: "900"
Return: "4"
Return1: "0.10"
Return3: "0.40"
Return5: "0.70"
Return10: "0.90"
StartDate: "2019-06-14"
},
But, I am trying to take all Return data to some return array which I need to show each index of data into flatlist. But, Here I got confuse how to take it into another array because Return key has 1,3,5, etc at the ending of the key in each index.
const ValuesData = [];
if (ReturnsData) {
ReturnsData.map((item, index) => {
ValuesData.push({
`${ReturnsData[index].Return`${index}`}`,
});
});
}
Can anyone suggest me how to take Return(1,3,5,10) data into array?