I am trying to combine data.id with company.action.actions but I keep getting an error:
TypeError: Cannot set property '10' of undefined
This is my current code:
company.action={};
company.getOptions=function(){
// company.action={};
// var toto;
//company.action.actions15=true;
for(var i=0;i<company.selectedActionsForCompany.length;i++){
var data=company.selectedActionsForCompany[i];
company.action.actions[data.id]=true;
}
console.log(JSON.stringify(company.action));
}
Any suggestions on how to resolve this issue?