[
{
"dateFrom": "2018-11-27",
"dateTo": "2018-11-27",
"number": 1,
"instrumentKey": 6,
"type": "CASH",
"size": 5,
"accountNumber": "000000000000000",
"currency": "USD",
"settledAmount": 0,
"unsettledAmount": 11,
"blockedAmount": 0
}
]
индекс в массиве в качестве ключа — не лучшая идея?
getUserData = (userData, criteria) => {
let key = 0;
let items = usersData.map((number) =>
{return {name: number[criteria]}}
);
for (let i of items) {
i.key = key++;
}
return items
});
getUserData(userData, criteria)
.then(items => {
console.log(items);
});
getExchangeList = (API) => {
axios.get(API+"/exchange", {
})
.then(res => {
const exchange = res.data
})
.catch(function (error) {
console.log(error);
});
};