- 方案:重寫(xiě)console的所有方法
- 場(chǎng)景:生產(chǎn)環(huán)境不想看到任何報(bào)錯(cuò)警告的簡(jiǎn)單做法
當(dāng)然還是建議大家從代碼層面出發(fā)解決雀扶,不要報(bào)錯(cuò)~,不要依賴此方法
window.console = (function() {
var c = {};
c.log = c.warn = c.debug =
c.info = c.error = c.time =
c.dir = c.profile = c.clear =
c.exception = c.trace = c.assert = function() {};
return c;
})();