Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.clear();
- Object.prototype.parent = function (supClass) {
- tempObj = new supClass();
- for (property in tempObj) {
- this[property] = tempObj[property];
- }
- };
- function Bazowa() {
- this.value = 5;
- this.metoda1 = function () {
- console.log("Bazowa::metoda1() " + this.value);
- }
- this.metoda2 = function () {
- console.log("Bazowa::metoda2()");
- }
- }
- function Pochodna() {
- this.parent(Bazowa);
- this.metoda1 = function () {
- console.log("Pochodna::metoda1() " + this.value);
- }
- }
- x = new Pochodna();
- y = new Bazowa();
- x.metoda1();
- y.metoda1();
Advertisement
Add Comment
Please, Sign In to add comment