Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myObj = () => ({
- __proto__: {},
- extend: function (template) {
- Object.entries(template).forEach(([key, value]) => {
- if (typeof value === "function") {
- this.__proto__[key] = value;
- } else {
- this[key] = value;
- }
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement