According to spec
- If IsCallable (func) is false, throw a TypeError exception.
funcis the object on which the method is invoked apply.
applyallows you to specify the context functionlater, which undefinedin your case, since the Function (which should be specified in the arguments) mhas no context .
Since the arguments
TypeError: Function.prototype.apply undefined, undefined,
,
1:
m = Math.max.apply.bind(this)
m(this, [1,2,3])
TypeError: Function.prototype.apply , ,
2:
m = Math.max.apply.bind(null)
m(this, [1,2,3])
TypeError: Function.prototype.apply null, ,
3: ( , )
m = Math.max.apply.bind(function(){})
m(this, [1,2,3])
undefined
4: (, )
m = Math.max.apply.bind(Math.max)
m(this, [1,2,3])
3