Why do we need the create and construct functions

dwk7u7st

New Member
Why is it useful to have these two functions, create and construct\[code\]if (!Object.create) { Object.create = function(base) { function F() {}; F.prototype = base; return new F(); }}if (!Object.construct) { Object.construct = function(base) { var instance = Object.create(base); if (instance.initialize) instance.initialize.apply(instance, [].slice.call(arguments, 1)); return instance; }}\[/code\]
 
Back
Top