Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Foo(name){
- this.name = name;
- };
- Foo.prototype.getName = function() {
- console.log("Name is " + this.name);
- };
- var myFoo = new Foo('MyFoo');
- // myFoo.getName();
- function Bar(name) {
- this.name = name;
- };
- Bar.prototype = inherit(Foo.prototype);
- var myBar = new Bar('MyBar');
- myBar.getName();
Advertisement
Add Comment
Please, Sign In to add comment