6 lines
248 B
JavaScript
6 lines
248 B
JavaScript
(function (Constructor, args) {
|
|
var instance = Object.create(Constructor.prototype);
|
|
var result = Constructor.apply(instance, args);
|
|
return result != null && (typeof result == "object" || typeof result == "function") ? result : instance;
|
|
});
|