I need to set my for loop length dynamically.
After my condition is true, I need to set dynamically objects in my permission array inside for loop.
Heare is my code:
if (obj[k]===pathData[i]){
//pathData[i]=order
for (let l = 0; l <permission[j].pathData[i].statusChange.length; l+=1) {
}
}
My code is not working...I really need your help.
var permissionObjKeys = Object.keys(permissions[j])
for(permissionObjKey of permissionObjKeys){
permissions[j][permissionObjKey].statusChange.push('new-permission')
}
try this it will work inside the dynamic object present in the permission array.