让Javascript严格执行

发布于 2024-12-28 02:07:20 字数 490 浏览 1 评论 0原文

目前,我正在尝试通过在 Gedit 中编写代码然后尝试通过 Firefox 执行它来学习 Javascript。

然而,每当我的代码中遇到错误时,网络浏览器往往会默默地失败,而且我无法完全摆脱这样的感觉:它也忽略了我代码中的其他更小的问题。我真的很想以正确的方式学习 Javascript,而不是无意中养成编写微妙错误代码的习惯。

有没有一种方法可以设置网络浏览器或运行 Javascript,以便它在每个错误或错误时大声尖叫,无论多么小?

我研究了 jslint ——还有其他我可能错过的方法可以实现这一点吗?

我也很快(阅读:5 分钟)查看了 严格模式 但我不确定如果那是同一件事的话。

Currently, I'm trying to learn Javascript by writing my code in Gedit then attempting to execute it via Firefox.

However, web browsers tend to fail silently whenever it encounters an error in my code, and I can't quite shake the feeling that it's also ignoring other, more minor, problems in my code. I'd really like to learn Javascript the right way, and not accidentally get in the habit of writing subtly wrong code.

Is there a way to set up a web browser or run Javascript so it screams loudly at every error or mistake, no matter how minor?

I looked into jslint -- are there any other ways of accomplishing this that I might have missed?

I also quickly (read: 5 minutes) looked at strict mode but I'm not sure if that's the same thing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

起风了 2025-01-04 02:07:20

使用 firebug 中的控制台查看错误。 Chrome 有自己的内置控制台,可用于相同目的。然而,jslint 将比任一控制台严格得多。

Use the console in firebug in order to view errors. Chrome has its own built in console which can be used for the same purpose. However, jslint is going to be much stricter than either console.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文