* Implement function Callit, after the call to meet the following conditions
1. The result returned is the result after the call to FN
2, the call parameter of FN is callit all parameters after the first parameter
function Callit (FN) { return fn.apply (This, [].slice.call (arguments, 1));} TESTVAR fn = function (A, B, c) {return a+b+c;} Callit (FN, 1, 2, 3); 6
* Implement function Partialusingarguments, after the call satisfies the following conditions:
1. Returns a function result
2. After calling result, the returned result is consistent with the result of calling the function fn
3, the call parameter of FN is partialusingarguments all parameters after the first parameter and the call parameter of result
function Partialusingarguments (FN) { var args = [].slice.call (arguments, 1); return function () { //[].slice.call (arguments) = = Convert arguments pseudo-array to array return fn.apply (This, Args.concat ([] . Slice.call (arguments)) }}
JavaScript call/apply