here is my code:
useraccountprofileJSON.providerprofile.openinginfo.forEach(function(instance_1){
instance_1.openingdetail.openingapplication.forEach(function(instance_2){
console.log(instance_2);
if(instance_2.oaid == oaid){
isowner = true;
}
});
});
When I execute this I get the following error:
[TypeError: Cannot read property 'openingapplication' of undefined]
The error is because the last item(i.e last openingdetail) comes undefined in forEach iterations.
How to solve this?