<!DOCTYPE html>
<html>
<head>
<title>chrome</title>
</head>
<body>
<script type="text/javascript">
console.log(Window); //构造函数Window,由浏览器内核原生代码实现 [native code]
try{
ww = new Window(); //Window对象无法直接在JS脚本中实例化
}
catch(error){
console.log(error); // TypeError (native)
}
console.log(this.constructor == Window); //true,浏览器this对象,指向一个Window对象
console.log(this); //瞅瞅Window对象提供了哪些属性和方法供开发者使用
console.log(window == this); //true
console.log(this.window == this); //true,window即this.window与this指向同一个Window对象
</script>
</body>
</html>
理清浏览器Window对象&window对象&this对象
最新推荐文章于 2022-01-19 23:00:08 发布