When I edit production code (little fixes) I want to add console.log
for example, but not to break page for users who don't have firebug or don't use chrome I decide to redefine console object:
if (console == undefined) {
console = {
log : function(){},
info : function(){},
warn : function(){},
error : function(){}
};
};
After I inserted this code, JS-execution was broken in browsers that don't have console object (IE, firefox without firebug, etc). (By "broken" I mean that code after these lines doesn't execute at all) Why did it happen?