function People(name) {
this.name = name;
this.sayName = function () {
console.log('my name is:' + this.name);
}
}
People.prototype.walk = function () {
console.log(this.name + ' is walking'); 这里面this指向的是谁啊?
}
var p1 = new People('我们');
var p2 = new People('在这里');
People.prototype.walk()不好意思,问题没描述完全,这样这个函数里面的this代表了什么
肥皂起泡泡
小唯快跑啊
相关分类