I have following function:
let newArray = apiArr
.filter(function (data) {
if (data.parentId == detailsOfSelectedValue.id) {
return data
}
})
.map(function (item) {
return item.name
})
Here, Filter condition is right, after filter in map I want name and type both in return.
How can I do that?