题解 | #函数的上下文#
函数的上下文
http://www.nowcoder.com/practice/5e97b94794bd438f893137b2d3b28a6a
function speak(fn, obj) { //return fn.call(obj) //return fn.apply(obj) // return fn.bind(obj)() obj.fn = fn return obj.fn() }
函数的上下文
http://www.nowcoder.com/practice/5e97b94794bd438f893137b2d3b28a6a
function speak(fn, obj) { //return fn.call(obj) //return fn.apply(obj) // return fn.bind(obj)() obj.fn = fn return obj.fn() }
相关推荐