Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. var Car = {
  2.  
  3. init: function(make, model, year) {
  4. this.make = make;
  5. this.model = model;
  6. this.year = year;
  7. },
  8. sayCar: function() {
  9. // alert this.make
  10. }
  11. };
  12.  
  13. var johnCar = Object.create(Car);
  14. // required initialization
  15. johnCar.init('Ford', 'F150', '2011');
  16.  
  17. // Objects delegate to one another
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement