Ecmascript 6 奇怪的console.log行为
我觉得问这个问题有点愚蠢Ecmascript 6 奇怪的console.log行为,ecmascript-6,google-chrome-devtools,console.log,Ecmascript 6,Google Chrome Devtools,Console.log,我觉得问这个问题有点愚蠢 "use strict"; console.log("youhou"); var countdown = void 0; function timer(secondes) { var now = Date.now(); var then = now + secondes * 1000; console.log({ now: now, then: then }); } 但是当我检查google开发工具上所有的console.log时,第一个并没有弹出
"use strict";
console.log("youhou");
var countdown = void 0;
function timer(secondes) {
var now = Date.now();
var then = now + secondes * 1000;
console.log({ now: now, then: then });
}
但是当我检查google开发工具上所有的console.log时,第一个并没有弹出并说“youhou”来确认它是否有效
然后,当我在GDT中写入计时器(10)时,它会说
VM892:1 Uncaught ReferenceError: timer is not defined
at <anonymous>:1:13
VM892:1未捕获引用错误:未定义计时器
时间:1:13
我的功能很明确我很困惑我不明白?
另外,在codpen中,一切都很好
有人能帮忙吗 我在控制台上运行你的代码我没有收到任何错误是的,它工作正常,我没有收到错误。在不使用“use strict”的情况下进行检查,或在“new”选项卡上打开,这样console就不会缓存您输入的代码听起来您是新Chrome中中断的控制台过滤的受害者,请参阅和