/ Published in: JavaScript

an operator that implements true prototypal Object inheritance in JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {} F.prototype = o; return new F(); }; } newObject = Object.create(oldObject);
URL: http://javascript.crockford.com/prototypal.html
Comments
