Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( typeof Object.create !== "function" ) {
- Object.create = function (o) {
- var F = function () {};
- F.prototype = o;
- return new F();
- };
- }
- var Engin = function (carbu) {
- this.carbu = typeof carbu !== "string" ? "diesel" : carbu;
- };
- Engin.prototype = {
- roule: function () {
- return this.carbu + ' vroum engin! ;3';
- }
- };
- var Voiture = function (carbu) {
- this.carbu = typeof carbu !== "string" ? "sans plomb" : carbu;
- };
- Voiture.prototype = Object.create(Engin.prototype);
- Voiture.prototype = {
- roule: function () {
- return this.carbu + ' vroum voiture :3';
- }
- };
- var Tracteur = function (carbu) {
- this.carbu = typeof carbu !== "string" ? "trac" : carbu;
- };
- Tracteur.prototype = Object.create(Engin.prototype);
- Tracteur.prototype = {
- roule: function () {
- return this.carbu + ' vroum tracteur :3';
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement