Below is the JSON data provided:
users = [{
"name": "alex",
"id":123,
"surname":"xx",
tarriff: {
"id":1,
"name":"free"
}
},
{
"name": "tom",
"id":124,
"surname":"henry",
tarriff: {
"id":1,
"name":"free"
}
}
]
I am seeking assistance in filtering this data (specifically removing "surname":"xx", "surname":"henry" and others).
When attempting to use tarriff.name
, it results in a syntax error.
$scope.userfilter = users.map(({name,id, tarriff.name}) => ({name, id, tariff_name}));
Please help me in finding the correct solution for this problem.