I have got an object . I need to get remove array of objects property if it's empty . For. example, test and books will be removed and give other values .
const PermissionObj = {
permission: [
{
"test": []
},
{
"books": []
},
{
"Journals": [
{
"label": "Can View",
"value": "can_view"
},
{
"label": "Can Create",
"value": "can_create"
}
]
},
{
"deal": [
{
"label": "Can update",
"value": "can_update"
},
{
"label": "Can delete",
"value": "can_delete"
}
]
}
]
};
I am using double loop for solving this , but I am really trouble with this