JavaScript: Check for Console object in global scope