更新时间:2023-11-09 09:02:34
你不应该在if中创建函数。你做得好多了:
You should not be creating function inside if block. You are much better off doing:
var e = function(){};
if(typeof console === "object" && typeof console.error === "function"){
e = function (msg){ ... };
}