If we wont to find out whether a JavaScript object supports a certain property or method, we can simply test for it:

if(MyObject.someProperty){...}

This will fail, however, if MyObject.someProperty has been assigned the boolean value false, or a numerical 0, or the special value null. A more rigorous test would be to write:

if(typeof(MyObject.someProperty) != "undefined") {...}