全局的对象也是window的对象,全局的方法也是window的方法
<script>var a=10;function go(){console.log("hello world");}// const window = {// a:10,// go:function(){// console.log("hello world");// }// }console.log(window.a)</script>var age =15;//声明一个全局变量window.name="chengchao";//相当于var name = "chengchao"
