Handle non existant array element

Handle non existant array element

I have the following array

var arraydata={NOT1NO:{ field1: 'NOT1NO', field2: 'DURcy', field3: 'valuta', field4: 'INF'},NOT2NO:{ field1: 'NOT2NO', field2: 'DURcy', field3: 'valuta', field4: 'INF'}};

I easily access parts of the array like arraydata.NOT1NO.field1.

But if for some reason I try to access a part of the array that does not exist, like arraydata.NOT1NO.field22, the whole script stops to function. Is there a way to handle this? For instance:

if (arraydata.NOT1NO.field22 DOESNT EXIST) {do something} else {do something else};

I have tried .length, .inarray but not found a working solution.

Any help appreciated.