![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6
anyw_
这个作者很懒,什么都没留下…
展开
-
ES6语法、this指向
ES6语法 ES6语法新增的变量的定义 let 定义变量 特点: 1.let定义的变量,不会进行预解析 <script> console.log(int1); // var 关键词定义的变量,可以预解析,结果 undefined console.log(int2); // let 关键词定义的变量,不能徐解析,结果 报错 var int1 = 100; let int2 = 100; </script> 2.let 定义的变量,与forEach()中原创 2020-07-17 20:49:26 · 707 阅读 · 0 评论 -
ES5|ES6继承
继承 原型继承 优点: 如果Student继承了Human,那么Student的实例对象不单有Student定义的属性和方法,还将拥有Human的属性和方法,Student的原型prototype上的属性,将会保留在实例对象的 __proto__上,也就是原型上属性和方法就是实例对象上的属性和方法 Student.prototype = new Human();这样的话所有的Student的实例都将拥有Student.prototype原型上的属性和方法,也就是Human实例的属性和方法,s1是stude原创 2020-07-17 20:30:18 · 76 阅读 · 0 评论