1.类中默认使用局部严格模式
#this指向该类实例对象
例:
class Person{
constructor(name){
this.name = name
}
study(){
console.log(this)
}
}
const p1 = new Person()
p1.study()//this只想p1(实例对象)通过实例调用方法
const x = p1.study
x()//undefined 直接调用.因严格模式所以不只想window 而是undefined
function aaa(){
'use stric'
console.log(this)//undefined
}
