I am currently working on a function with a parameter called menu
.
removeChildCheck:function(menu){
let removeArrayValues = [];
for(var i=0; i < this.checkbox.menu.length; i++){
removeArrayValues.push(this.checkbox.menu[i].value);
}
this.user.permissions = this.user.permissions.filter((i) => !removeArrayValues.includes(i));
},
However, when I invoke it like this removeChildCheck('dashboard')
, I encounter an error where the length is undefined.
Does anyone know how to properly append the param
and iterate over it? Thank you in advance. TIA