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) => {
return new Promise(resolve => {
let key = 0;
let items = usersData.map((number) =>
{return {name: number[criteria]}}
);
for (let i of items) {
i.key = key++;
}
resolve(items)
})
};