this是什么?this是指针?指针指向实例化的对象?都太抽象,this其实就是一个变量,是一个对象
var that = {
Animal: function (name) {
this.name = name
this.sayName = function () {
console.log(this.name)
}
}
}
that.Animal(‘Black Cat’)
that.sayName() // Black Cat
this是什么?this是指针?指针指向实例化的对象?都太抽象,this其实就是一个变量,是一个对象
var that = {
Animal: function (name) {
this.name = name
this.sayName = function () {
console.log(this.name)
}
}
}
that.Animal(‘Black Cat’)
that.sayName() // Black Cat