i have this data sample,
{
"section": [
{
"id": 1,
"name" : "dogs"
},
{
"id": 2,
"name" : "cats"
}
],
"price" : [
{
"name" : "monthly",
"price": {
"amount": 10
}
}
],
"specs": {
"color" : {
"name" : "green"
}
}
}
i want to pick some properties from that object, like that
const obj = pick(obj,["section.id","price.price"])
it should gives an object:
{
"section": [
{
"id": 1,
},
{
"id": 2,
}
],
"price" : [
{
"price": {
"amount": 10
}
}
],
}
i tried lodash.pick() and didn't understand the array of object case, it understand it if i used this syntax "section[0].name" and i want it generic, like "section.name"