Alex A
asked on
JavaScript function()
Can anyone explain meaning of the code below and whether I can safely remove it?
if (typeof (console) === "undefined) {
var console = {};
var console.log = function() { };
var console.error = function() { };
var console.trace = function() { };
}
Thank you.
if (typeof (console) === "undefined) {
var console = {};
var console.log = function() { };
var console.error = function() { };
var console.trace = function() { };
}
Thank you.
what is the context? why removing? you don't need bottle of oxygen on earth until you're under sea
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
You are welcome.
If you remove it then in case there is such a null or undefined value you can't tell what the rest of the code would do.
Unless of course you do! :)