if(blah.error) will fail if error is "" or 0 or false or underfined or null. So if it doesn't exist (as long as the owning object exists), it'll work fine. Don't set things you don't need in JavaScript (so: no setting to 'null' =)