Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Foo(who){
- this.me =who;
- }
- Foo.prototype.identify= function() {
- return "I am" +this.me;
- };
- var a1 = new Foo("a1");
- var a2 = new Foo("a2");
- a2.speak = function(){
- alert("Hello" +this.identify() + ".");
- };
- a1.constuctor === Foo;
- a1.constructor === a2.constructor;
- a1.__proto__ === Foo.prototype;
- a1.__proto__ === a2.__proto__;
Add Comment
Please, Sign In to add comment