<script>
function Star(uname, age) {
this.uname = uname;
this.age = age;
}
var that;
Star.prototype.sing = function () {
console.log("我会唱歌");
that = this;
};
//1、原型对象和构造函数里面的this指向的都是实例对象ldh
console.log(that);
</script>
712_原型对象的this指向
- 本文链接: http://lzkpersonal.com.cn/2023/07/12/712-原型对象的this指向/
- 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!