Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js] 第266天 window.console.log()和console .log()有区别吗?体现在哪里? #1744

Open
haizhilin2013 opened this issue Jan 6, 2020 · 3 comments
Labels
js JavaScript

Comments

@haizhilin2013
Copy link
Collaborator

第266天 window.console.log()和console .log()有区别吗?体现在哪里?

作者:cxwht

我也要出题

@haizhilin2013 haizhilin2013 added the js JavaScript label Jan 6, 2020
@Aoki1999
Copy link

Aoki1999 commented Jan 7, 2020

要看上下文环境吧!一般都是window下的。

@wheatup
Copy link

wheatup commented Jan 7, 2020

不一样,window.console.log只能在浏览器中使用

console.log在浏览器、Node等其他环境中都可以使用

@xiaoqiangz
Copy link

xiaoqiangz commented Aug 26, 2022

两者在浏览器环境下都是一样的功能,但是在node环境中window.console.log就不可以了,因为它没有window对象。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
js JavaScript
Projects
None yet
Development

No branches or pull requests

4 participants