Guest User

Untitled

a guest
Apr 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function Foo(who){
  2. this.me =who;
  3. }
  4. Foo.prototype.identify= function() {
  5. return "I am" +this.me;
  6. };
  7.  
  8. var a1 = new Foo("a1");
  9. var a2 = new Foo("a2");
  10.  
  11. a2.speak = function(){
  12. alert("Hello" +this.identify() + ".");
  13. };
  14.  
  15. a1.constuctor === Foo;
  16. a1.constructor === a2.constructor;
  17. a1.__proto__ === Foo.prototype;
  18. a1.__proto__ === a2.__proto__;
Add Comment
Please, Sign In to add comment