01-window

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    // 当我们是用window的成员的时候,window可以省略
    // window.document
    // window.alert('hello');
    

    // 定义的全局变量都属于window ,都是window对象的属性
    // var age = 18;
    // console.log(window.age);
    // 
    // console.dir(window);
    // 
    // name 是window的属性,是字符串类型
    var name = 123;
    console.log(name);

    window.console.log('hello');
    // top 是window的属性,只能获取不能赋值
    var top = 'top';
    console.log(top);

    var age = 18;
    console.log(age);


  </script>
</body>
</html>
别废话,拿你代码给我看。
原文地址:https://www.cnblogs.com/lvxueyang/p/13707410.html