MCPcopy Create free account
hub / github.com/codrops/RainEffect / construct

Function construct

demo/js/index.js:1850–1856  ·  view source on GitHub ↗
(F, len, args)

Source from the content-addressed store, hash-verified

1848});
1849
1850var construct = function(F, len, args){
1851 if(!(len in factories)){
1852 for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';
1853 factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
1854 }
1855 return factories[len](F, args);
1856};
1857
1858// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
1859$def($def.P, 'Function', {

Callers 1

boundFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected