mardi 2 février 2016

Comparing to null values

I am trying to check if value is NULL before I process the flow..

 if (index === 'serving_obj' && nutritionArray['size'] !=='') {
 }

It keeps return this error

Uncaught TypeError: Cannot read property 'size' of null

I am testing if it's null or not. Why the browser read it before testing it??

Aucun commentaire:

Enregistrer un commentaire