在vscode中运行代码时如何让js代码在chrome开发者控制台下显示

问题描述

我正在使用 vscode 来学习 javascript,但是由于某种原因,当我在 console.log = ('hello world'); 文件中运行代码 .js 或在 html 文件的正文中使用 script 标记时,没有任何显示在 chrome 开发者控制台部分。但是,如果我在 .jshtml 中使用警报,则正常显示就在那里。

谁能帮我解决这个问题?谢谢!

enter image description here

解决方法

因为你用错了

console.log("hello")

不是

console.log = "hello"