Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Base = {
- _ops: {},
- _privateFnc: function () {},
- abstract: function () {},
- init: function (ops) {
- this._ops = ops || {};
- // INIT
- }
- };
- var Thing = (function () {
- var ThingBase = Object.create(Base);
- ThingBase = {
- abstract: function() {
- return this._ops;
- }
- };
- return function (ops) {
- var instance = Object.create(ThingBase);
- instance.init(ops);
- return instance;
- };
- })();
- var thingA = Thing(),
- thingB = Thing({foo:'bar'});
Add Comment
Please, Sign In to add comment