$$
对象中的方法怎么访问自己的属性
$$
var nik = {
name: 'zs',
say: function () {
console.log('hello'+this.name)
},
spak: function () {
console.log('how are you ding'+this.name)
}
}
nik.say()
- 通过this我们能够访问自己
$$
对象中的方法怎么访问自己的属性
$$
var nik = {
name: 'zs',
say: function () {
console.log('hello'+this.name)
},
spak: function () {
console.log('how are you ding'+this.name)
}
}
nik.say()