I have json:
{
"userList":
[{
"name": "Bob",
"age": 28
},{
"name": "Tom",
"age": 45
},{
"name": "Alice",
"age": 32
}]
}
I want to cut only age and put them to array like : public mainChartData1: Array = [28, 45, 32];
I have started to do that by next code:
const arr = this.users.map(obj => {
var localObj = [];
localObj[obj] = obj.age;
return localObj;
});
But it doesn't work.