this

this的使用场景:

1,计时器中使用

2,class的构造函数使用

3,箭头函数的使用

4,call,apply,bind的使用

5,全局下的this

this的取值是在执行的时候定义的,不是在定义的时候。

箭头函数的this,取决于箭头函数所在的作用域。

 

class:eg: zhangsan.name = '张三'

 

posted @ 2020-09-22 15:23  毛栗的demo  阅读(129)  评论(0)    收藏  举报