Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

apply js

Function.prototype.construct = function (aArgs) {
  let fNewConstr = new Function("");
  fNewConstr.prototype = this.prototype;
  let oNew = new fNewConstr();
  this.apply(oNew, aArgs);
  return oNew;
};
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #apply #js
ADD COMMENT
Topic
Name
2+3 =