Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function A() {}
- A.foo = "foo";
- A.prototype = {bar: function () { return "bar"; }};
- function B() {}
- B.baz = "baz";
- B.prototype = new A();
- B.prototype.qux = function () { return "qux"; };
- var b = new B();
- b.quo = "quo";
- console.log(b.quo); //-> "quo"
- console.log(b.qux()); //-> "qux"
- console.log(b.baz); //-> undefined
- console.log(B.baz); //-> "baz"
- console.log(b.bar()); //-> "bar"
- console.log(b.foo); //-> undefined
- console.log(B.foo); //-> undefined
- console.log(A.foo); //-> "foo"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement