I am wondering what the exclamation mark in if(!anObject) means.
if(!anObject)
That is the Logical NOT operator, i.e., if( thisThisIsNotTrue ) { doStuff }.
if( thisThisIsNotTrue ) { doStuff }