this指向问题(1)
一、构造函数中的this
// 1.普通构造函数的方法调用,this指向当前创建的实例化对象
function Person(name, age) {
this.name = name;
this.age = age;
this.say = function () {
console.log(this.name); //linlin this指向当前实例化出来的的对象
console.log(this); //Person { na
原创
2020-09-03 01:35:56 ·
156 阅读 ·
0 评论