I am reading a json variable and extracting information from it.
I have the fields of the properties in an array. Everything is fine until the field I'm looking for does not exist
the application gives an error of type:
I have tried all the options I found on the network to control the error:
1.var tipo = typeof PropModelo[HayarIndice(Nodos[j])].properties[nombreNivel][value]);
if (tipo ==="undefined") //error cuando carga la variable "tipo".
2.if(PropModelo[HayarIndice(Nodos[j])].properties[nombreNivel][value] === void 0)//error cuando se mencionan las propiedades.
In summary I have tried all the solutions that have been presented to me by the network and it keeps giving me error whenever it is mentioned:
PropModelo[HayarIndice(Nodos[j])].properties[nombreNivel][value]
How can I control the error? I need that the variables that do not have this field do not break the execution of the program. Thanks.