JS Window Global Object

爷,独闯天下 提交于 2019-12-30 07:48:02

问题


I have learned that the Window Global Object is the top level Object. He is the "box" of all the codes its Contain the DOM,BOM,and The JS.

I have learned that the window object represents an open window in a browser, and also that the window object has no constructor which means I can't create its instance.

I have learned that the object is automatically created by the Browser. What I wanted to ask is how?

I mean if it has no constructor, so the browser can't create its own instance to the object. I was thinking that the browser must be able to some way create it, so my question is how does the browser create it? I'll be happy if some one will help me to understand this.


回答1:


No constructor?

>> window.constructor
[object Window]

Well, what do you know, a constructor!

That said...

>> new Window
(X) Object does not support this action

So I guess that means only native code can create new instances of Window.



来源:https://stackoverflow.com/questions/10035771/js-window-global-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!