如何解决“Uncaught TypeError: console is not a function script.js:1:1”错误

问题描述 投票:0回答:1

我只是创建一个 script.js 并将其与 index.html 连接 在 script.js 中我写 console("Hello World from js");

我想在浏览器控制台中看到控制台语句 Hello World from js。所以我转到控制台,RC>检查>控制台, Browser Console Output 我收到一个错误enter image description here

有人可以帮我解决这个问题吗?

我想在浏览器控制台中看到清晰的输出来自js的Hello World

javascript console typeerror
1个回答
0
投票
我认为你的意思是写

console.log('hello world')

© www.soinside.com 2019 - 2024. All rights reserved.