function fn() {
console.log('函数fn');
console.log(this);
}
var l = {
name: 'lisa'
}
// fn()
fn.call(l)
// call 可以调用函数 改变函数的this指向 可以实现继承
function father(uname, age, sex) {
this.uname = uname
this.age = age
this.sex = sex
}
function son(uname, age, sex) {
father.call(this, uname, age, sex)
}
var son = new son('章三', 18, '男')
console.log(son);
// apply 可以改变this指向 参数为数组(伪数组)
var p = {
name: 'lisa'