思路:使用call、apply、bind,注意区别即可。

function speak(fn, obj) 
{
    return fn.call(obj)
}
function speak(fn, obj) 
{
    return fn.apply(obj)
}
function speak(fn, obj) 
{
    return fn.bind(obj)()
}

总结:call()、bind()、apply()的用法,改变this的指向,区别在于:f.bind(obj, arg1, arg2,...)(),bind()方法创建一个新的函数,故需要自己调用;f.call(obj, arg1, arg2...),call()方法在调用函数后会返回函数的执行结果,call可以接受多个参数;f.apply(obj, [arg1, arg2, .]),apply()方法在调用函数后会返回函数的执行结果,apply可以接受一个数组参数列表。