Guest User

Untitled

a guest
Sep 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // Use it :
  2.  
  3. var Human = Kind.extend({
  4. toString : function() { console.log("hello : ", this); },
  5. initialize : function (name) {
  6. console.log("human constructor");
  7. this.name = name
  8. }
  9. });
  10.  
  11. //Someone inherits of Human
  12. var SomeOne = Human.extend({
  13. initialize : function(name){
  14. //call parent constructor
  15. SomeOne.__super__.initialize.call(this, name);
  16. }
  17. });
  18.  
  19. var Bob = new Human("Bob");
  20. Bob.toString();
  21.  
  22. var Sam = new SomeOne("Sam");
  23. Sam.toString();
Add Comment
Please, Sign In to add comment