How to use null
There are many functions and methods out there in the world that return objects, and you’ll often want to make sure what you’re getting back is a full-fledged object, and not
null, just in case the function wasn’t able to find one or make one to return to you. You’ve already seen examples from the DOM where a test is needed:
- 7. Types, Equality, Conversion and All That Jazz: Serious types
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
How to use "null" to check if an object exists?