MCPcopy
hub / github.com/lodash/lodash / apply

Function apply

lodash.js:486–494  ·  view source on GitHub ↗

* A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The ar

(func, thisArg, args)

Source from the content-addressed store, hash-verified

484 * @returns {*} Returns the result of `func`.
485 */
486 function apply(func, thisArg, args) {
487 switch (args.length) {
488 case 0: return func.call(thisArg);
489 case 1: return func.call(thisArg, args[0]);
490 case 2: return func.call(thisArg, args[0], args[1]);
491 case 3: return func.call(thisArg, args[0], args[1], args[2]);
492 }
493 return func.apply(thisArg, args);
494 }
495
496 /**
497 * A specialized version of `baseAggregator` for arrays.

Callers 8

baseInvokeFunction · 0.85
wrapperFunction · 0.85
createOverFunction · 0.85
overRestFunction · 0.85
unzipWithFunction · 0.85
lodash.jsFile · 0.85
spreadFunction · 0.85
condFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected