Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Car = {
- init: function(make, model, year) {
- this.make = make;
- this.model = model;
- this.year = year;
- },
- sayCar: function() {
- // alert this.make
- }
- };
- var johnCar = Object.create(Car);
- // required initialization
- johnCar.init('Ford', 'F150', '2011');
- // Objects delegate to one another
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement