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内置对象上一些不理解的地方 #13

Closed
JackChengGZ opened this issue Dec 26, 2020 · 1 comment
Closed

关于JS内置对象上一些不理解的地方 #13

JackChengGZ opened this issue Dec 26, 2020 · 1 comment

Comments

@JackChengGZ
Copy link

1.这个全局对象跟内置对象是父子关系吗,这个全局对象是指global还是指window;
2.这个全局对象上的属性:比如全局对象的函数属性parseInt,他指向全局函数parseInt()?或者说全局对象的构造器属性Array和内置对象Array的关系是什么,当我访问Array的时候是访问属性还是内置对象Array,还是说访问的是构造器; 比如:我在控制台输出
console.log(Array)是构造函数吗还是说叫内置对象?另外console.log(Array()) 这个我没有new,算实例化吗?
3.关于Math对象和Array为啥不一样;console.log(Math) 是这样{属性...};而console.log(Array)是function

@justjavac
Copy link
Owner

这个图是根据 ECMAScript 标准 ecma262 绘制的。

全局对象 nodejs 是 global,浏览器是 window。但是标准里面只有 globalThis

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

No branches or pull requests

2 participants