I have this object:
const data = {"avaiable_items": {"1": [201259, 201303],"2": [201303], "3": [201259]},"items": [{"id": "201259","name": "ABC"},{"id": "201303","name": "DEF"}]}
I need to filter "items"
based on "avaiable_items"
dynamic keys
Example if want to filter object based on selected avaiable_items
i.e "1"
, the result will be:
{"item": [{"id": "201259","name": "ABC"},{"id": "201303","name"}]}