Use the following piece of code:
if (typeof console == “undefined” || typeof console.log == “undefined”) var console = { log: function() {} };
Use the following piece of code:
if (typeof console == “undefined” || typeof console.log == “undefined”) var console = { log: function() {} };