What is the difference between the javascript errors "Cannot read property 'foo' of null" and "null is not an object" -


we're logging javascript errors , 1 error message has come lot null not object, example typeerror: null not object (evaluating 'foo[bar]'). in searches error , trying replicate error, continually cannot read property 'foo' of null error instead. cannot figure out way results in null not object error.

what difference between 2 errors , examples when 1 called instead of other?

one example is here

when assign null value object , try access of it's properties null not object.

so, if try call function on object has null value give error:

  • null not object in safari

  • cannot read property of null in chrome

  • typeerror: obj[1] null in firefox


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -