11 function apply(func, thisArg, args) {
12 switch (args.length) {
13 case 0:
return func.call(thisArg);
14 case 1:
return func.call(thisArg, args[0]);
15 case 2:
return func.call(thisArg, args[0], args[1]);
16 case 3:
return func.call(thisArg, args[0], args[1], args[2]);
18 return func.apply(thisArg, args);
21 module.exports = apply;